Changeset 46c0498 in mainline


Ignore:
Timestamp:
2009-09-21T16:09:42Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
edb14ca
Parents:
4b4668e
Message:

Make fat_unlink() return an error code instead of hitting an assertion on an I/O
error.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/fat/fat_ops.c

    r4b4668e r46c0498  
    606606            (childp->idx->pdi * sizeof(fat_dentry_t)) / bps,
    607607            BLOCK_FLAGS_NONE);
    608         assert(rc == EOK);
     608        if (rc != EOK)
     609                goto error;
    609610        d = (fat_dentry_t *)b->data +
    610611            (childp->idx->pdi % (bps / sizeof(fat_dentry_t)));
     
    613614        b->dirty = true;                /* need to sync block */
    614615        rc = block_put(b);
    615         assert(rc == EOK);
     616        if (rc != EOK)
     617                goto error;
    616618
    617619        /* remove the index structure from the position hash */
     
    627629
    628630        return EOK;
     631
     632error:
     633        fibril_mutex_unlock(&parentp->idx->lock);
     634        fibril_mutex_unlock(&childp->lock);
     635        fibril_mutex_unlock(&childp->idx->lock);
     636        return rc;
    629637}
    630638
Note: See TracChangeset for help on using the changeset viewer.