Changeset 4f46695e in mainline for uspace/srv/vfs/vfs_ops.c


Ignore:
Timestamp:
2009-05-09T08:39:28Z (15 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cf95bc0
Parents:
f4876df
Message:

Lookup a node's parent lexically rather than using the broken L_PARENT flag of
VFS_LOOKUP.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/vfs/vfs_ops.c

    rf4876df r4f46695e  
    990990                return;
    991991        }
     992        /* Determine the path to the parent of the node with the new name. */
     993        char *parentc = str_dup(newc);
     994        if (!parentc) {
     995                rwlock_write_unlock(&namespace_rwlock);
     996                ipc_answer_0(rid, rc);
     997                free(old);
     998                free(new);
     999                return;
     1000        }
     1001        char *lastsl = str_rchr(parentc + 1, L'/');
     1002        if (lastsl)
     1003                *lastsl = '\0';
     1004        else
     1005                parentc[1] = '\0';
    9921006        /* Lookup parent of the new file name. */
    993         rc = vfs_lookup_internal(newc, L_PARENT, &new_par_lr, NULL);
     1007        rc = vfs_lookup_internal(parentc, L_NONE, &new_par_lr, NULL);
     1008        free(parentc);  /* not needed anymore */
    9941009        if (rc != EOK) {
    9951010                rwlock_write_unlock(&namespace_rwlock);
Note: See TracChangeset for help on using the changeset viewer.