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


Ignore:
Timestamp:
2011-03-28T20:19:16Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
df147c7
Parents:
fd89cf9
git-author:
Vojtech Horky <> (2011-03-28 20:19:16)
git-committer:
Jiri Svoboda <jiri@…> (2011-03-28 20:19:16)
Message:

Devman must be robust against short reads.

File:
1 edited

Legend:

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

    rfd89cf9 rdc87f3fd  
    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);
Note: See TracChangeset for help on using the changeset viewer.