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


Ignore:
Timestamp:
2011-04-01T11:59:10Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9b640c42
Parents:
cd1e6b62 (diff), 27bdfa5 (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:

Development branch changes

File:
1 edited

Legend:

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

    rcd1e6b62 re353e85  
    274274        }
    275275       
    276         if (read(fd, buf, len) <= 0) {
     276        ssize_t read_bytes = safe_read(fd, buf, len);
     277        if (read_bytes <= 0) {
    277278                printf(NAME ": unable to read file '%s'.\n", conf_path);
    278279                goto cleanup;
    279280        }
    280         buf[len] = 0;
     281        buf[read_bytes] = 0;
    281282       
    282283        suc = parse_match_ids(buf, ids);
     
    11311132fun_node_t *find_fun_node_by_path(dev_tree_t *tree, char *path)
    11321133{
     1134        assert(path != NULL);
     1135
     1136        bool is_absolute = path[0] == '/';
     1137        if (!is_absolute) {
     1138                return NULL;
     1139        }
     1140
    11331141        fibril_rwlock_read_lock(&tree->rwlock);
    11341142       
     
    11401148        char *rel_path = path;
    11411149        char *next_path_elem = NULL;
    1142         bool cont = (rel_path[0] == '/');
     1150        bool cont = true;
    11431151       
    11441152        while (cont && fun != NULL) {
Note: See TracChangeset for help on using the changeset viewer.