Changeset 132ab5d1 in mainline for uspace/srv/devman/match.c


Ignore:
Timestamp:
2018-01-30T03:20:45Z (8 years ago)
Author:
Jenda <jenda.jzqk73@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
5a6cc679
Parents:
8bfb163 (diff), 6a5d05b (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 commit '6a5d05bd2551e64111bea4f9332dd7448c26ce84' into forwardport

Separate return value from error code in gen_irq_code*().

File:
1 edited

Legend:

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

    r8bfb163 r132ab5d1  
    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        }
     
    229230        }
    230231       
    231         ssize_t read_bytes = vfs_read(fd, (aoff64_t []) {0}, buf, len);
    232         if (read_bytes <= 0) {
    233                 log_msg(LOG_DEFAULT, LVL_ERROR, "Unable to read file '%s' (%d).", conf_path,
    234                     errno);
     232        size_t read_bytes;
     233        rc = vfs_read(fd, (aoff64_t []) {0}, buf, len, &read_bytes);
     234        if (rc != EOK) {
     235                log_msg(LOG_DEFAULT, LVL_ERROR, "Unable to read file '%s': %s.", conf_path,
     236                    str_error(rc));
    235237                goto cleanup;
    236238        }
Note: See TracChangeset for help on using the changeset viewer.