Changeset 0013b9ce in mainline for uspace/srv/fs/tmpfs


Ignore:
Timestamp:
2008-11-23T12:27:15Z (17 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7782030
Parents:
f714576
Message:

libfs operation link() should return standard error code instead of mere
true/false.

Location:
uspace/srv/fs/tmpfs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/fs/tmpfs/tmpfs_dump.c

    rf714576 r0013b9ce  
    6060        struct rdentry entry;
    6161        libfs_ops_t *ops = &tmpfs_libfs_ops;
     62        int rc;
    6263       
    6364        do {
     
    9495                        fname[entry.len] = 0;
    9596                       
    96                         if (!ops->link((void *) parent, (void *) node, fname)) {
     97                        rc = ops->link((void *) parent, (void *) node, fname);
     98                        if (rc != EOK) {
    9799                                ops->destroy((void *) node);
    98100                                free(fname);
     
    135137                        }
    136138                        fname[entry.len] = 0;
    137                        
    138                         if (!ops->link((void *) parent, (void *) node, fname)) {
     139
     140                        rc = ops->link((void *) parent, (void *) node, fname);
     141                        if (rc != EOK) {
    139142                                ops->destroy((void *) node);
    140143                                free(fname);
  • uspace/srv/fs/tmpfs/tmpfs_ops.c

    rf714576 r0013b9ce  
    7676static void tmpfs_node_put(void *);
    7777static void *tmpfs_create_node(dev_handle_t, int);
    78 static bool tmpfs_link_node(void *, void *, const char *);
     78static int tmpfs_link_node(void *, void *, const char *);
    7979static int tmpfs_unlink_node(void *, void *);
    8080static int tmpfs_destroy_node(void *);
     
    309309}
    310310
    311 bool tmpfs_link_node(void *prnt, void *chld, const char *nm)
     311int tmpfs_link_node(void *prnt, void *chld, const char *nm)
    312312{
    313313        tmpfs_dentry_t *parentp = (tmpfs_dentry_t *) prnt;
     
    318318        tmpfs_name_t *namep = malloc(sizeof(tmpfs_name_t));
    319319        if (!namep)
    320                 return false;
     320                return ENOMEM;
    321321        tmpfs_name_initialize(namep);
    322322        size_t len = strlen(nm);
     
    324324        if (!namep->name) {
    325325                free(namep);
    326                 return false;
     326                return ENOMEM;
    327327        }
    328328        strcpy(namep->name, nm);
     
    344344        }
    345345
    346         return true;
     346        return EOK;
    347347}
    348348
Note: See TracChangeset for help on using the changeset viewer.