Changeset 94e3a03 in mainline


Ignore:
Timestamp:
2017-12-09T21:15:26Z (6 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:
c81132d
Parents:
bd253241
Message:

Fix bool error returns in cdfs.

Turns out pointers are assignable to bool without warning. Who know?
Also, horrible practice.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/cdfs/cdfs_ops.c

    rbd253241 r94e3a03  
    963963
    964964/** Read the volume descriptors. */
    965 static bool iso_read_vol_desc(service_id_t sid, cdfs_lba_t altroot,
     965static int iso_read_vol_desc(service_id_t sid, cdfs_lba_t altroot,
    966966    uint32_t *rlba, uint32_t *rsize, cdfs_enc_t *enc, char **vol_ident)
    967967{
     
    970970        int rc = block_get(&block, sid, altroot + 16, BLOCK_FLAGS_NONE);
    971971        if (rc != EOK)
    972                 return false;
     972                return rc;
    973973       
    974974        cdfs_vol_desc_t *vol_desc = (cdfs_vol_desc_t *) block->data;
     
    982982            (vol_desc->version != 1)) {
    983983                block_put(block);
    984                 return false;
     984                return ENOTSUP;
    985985        }
    986986       
     
    10021002                 */
    10031003                block_put(block);
    1004                 return false;
     1004                return ENOTSUP;
    10051005        }
    10061006       
     
    10081008        if (block_size != BLOCK_SIZE) {
    10091009                block_put(block);
    1010                 return false;
     1010                return ENOTSUP;
    10111011        }
    10121012       
     
    10331033       
    10341034        block_put(block);
    1035         return true;
    1036 }
    1037 
    1038 static bool iso_readfs(cdfs_t *fs, fs_node_t *rfn,
     1035        return EOK;
     1036}
     1037
     1038static int iso_readfs(cdfs_t *fs, fs_node_t *rfn,
    10391039    cdfs_lba_t altroot)
    10401040{
    10411041        cdfs_node_t *node = CDFS_NODE(rfn);
    10421042       
    1043         if (!iso_read_vol_desc(fs->service_id, altroot, &node->lba,
    1044             &node->size, &fs->enc, &fs->vol_ident))
    1045                 return false;
     1043        int rc = iso_read_vol_desc(fs->service_id, altroot, &node->lba,
     1044            &node->size, &fs->enc, &fs->vol_ident);
     1045        if (rc != EOK)
     1046                return rc;
    10461047       
    10471048        return cdfs_readdir(fs, rfn);
     
    10741075       
    10751076        /* Check if there is cdfs in given session */
    1076         if (!iso_readfs(fs, rfn, altroot))
     1077        if (iso_readfs(fs, rfn, altroot) != EOK)
    10771078                goto error;
    10781079       
     
    11271128        uint32_t rsize;
    11281129        cdfs_enc_t enc;
    1129         if (!iso_read_vol_desc(service_id, altroot, &rlba, &rsize, &enc,
    1130             &vol_ident)) {
     1130        rc = iso_read_vol_desc(service_id, altroot, &rlba, &rsize, &enc,
     1131            &vol_ident);
     1132        if (rc != EOK) {
    11311133                block_cache_fini(service_id);
    11321134                block_fini(service_id);
    1133                 return EIO;
     1135                return rc;
    11341136        }
    11351137       
Note: See TracChangeset for help on using the changeset viewer.