Changeset 3317724 in mainline for uspace/srv/devman/devman.c


Ignore:
Timestamp:
2011-03-29T19:32:53Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
eea1dd5
Parents:
2cf95e8 (diff), 93ebe4e (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/devman/devman.c

    r2cf95e8 r3317724  
    266266        }
    267267       
    268         if (read(fd, buf, len) <= 0) {
     268        ssize_t read_bytes = safe_read(fd, buf, len);
     269        if (read_bytes <= 0) {
    269270                printf(NAME ": unable to read file '%s'.\n", conf_path);
    270271                goto cleanup;
    271272        }
    272         buf[len] = 0;
     273        buf[read_bytes] = 0;
    273274       
    274275        suc = parse_match_ids(buf, ids);
     
    11231124fun_node_t *find_fun_node_by_path(dev_tree_t *tree, char *path)
    11241125{
     1126        assert(path != NULL);
     1127
     1128        bool is_absolute = path[0] == '/';
     1129        if (!is_absolute) {
     1130                return NULL;
     1131        }
     1132
    11251133        fibril_rwlock_read_lock(&tree->rwlock);
    11261134       
     
    11321140        char *rel_path = path;
    11331141        char *next_path_elem = NULL;
    1134         bool cont = (rel_path[0] == '/');
     1142        bool cont = true;
    11351143       
    11361144        while (cont && fun != NULL) {
Note: See TracChangeset for help on using the changeset viewer.