Changeset f77c1c9 in mainline for uspace/srv/devman/match.c


Ignore:
Timestamp:
2017-12-08T21:03:35Z (7 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c19a5a59
Parents:
c1694b6b
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-07 19:44:55)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2017-12-08 21:03:35)
Message:

Return VFS handles separately from error codes.

File:
1 edited

Legend:

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

    rc1694b6b rf77c1c9  
    202202        struct stat st;
    203203       
    204         fd = vfs_lookup_open(conf_path, WALK_REGULAR, MODE_READ);
    205         if (fd < 0) {
     204        int rc = vfs_lookup_open(conf_path, WALK_REGULAR, MODE_READ, &fd);
     205        if (rc != EOK) {
    206206                log_msg(LOG_DEFAULT, LVL_ERROR, "Unable to open `%s' for reading: %s.",
    207                     conf_path, str_error(errno));
     207                    conf_path, str_error(rc));
    208208                goto cleanup;
    209209        }
    210210        opened = true;
    211211       
    212         if (vfs_stat(fd, &st) != EOK) {
     212        rc = vfs_stat(fd, &st);
     213        if (rc != EOK) {
    213214                log_msg(LOG_DEFAULT, LVL_ERROR, "Unable to fstat %d: %s.", fd,
    214                     str_error(errno));
     215                    str_error(rc));
    215216                goto cleanup;
    216217        }
     
    230231       
    231232        size_t read_bytes;
    232         int rc = vfs_read(fd, (aoff64_t []) {0}, buf, len, &read_bytes);
     233        rc = vfs_read(fd, (aoff64_t []) {0}, buf, len, &read_bytes);
    233234        if (rc != EOK) {
    234235                log_msg(LOG_DEFAULT, LVL_ERROR, "Unable to read file '%s': %s.", conf_path,
    235                     str_error(errno));
     236                    str_error(rc));
    236237                goto cleanup;
    237238        }
Note: See TracChangeset for help on using the changeset viewer.