Ignore:
File:
1 edited

Legend:

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

    rf77c1c9 r8d2dd7f2  
    202202        struct stat st;
    203203       
    204         int rc = vfs_lookup_open(conf_path, WALK_REGULAR, MODE_READ, &fd);
    205         if (rc != EOK) {
     204        fd = vfs_lookup_open(conf_path, WALK_REGULAR, MODE_READ);
     205        if (fd < 0) {
    206206                log_msg(LOG_DEFAULT, LVL_ERROR, "Unable to open `%s' for reading: %s.",
    207                     conf_path, str_error(rc));
     207                    conf_path, str_error(errno));
    208208                goto cleanup;
    209209        }
    210210        opened = true;
    211211       
    212         rc = vfs_stat(fd, &st);
    213         if (rc != EOK) {
     212        if (vfs_stat(fd, &st) != EOK) {
    214213                log_msg(LOG_DEFAULT, LVL_ERROR, "Unable to fstat %d: %s.", fd,
    215                     str_error(rc));
     214                    str_error(errno));
    216215                goto cleanup;
    217216        }
     
    230229        }
    231230       
    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));
     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);
    237235                goto cleanup;
    238236        }
Note: See TracChangeset for help on using the changeset viewer.