Changeset a6fc88a in mainline for uspace/app/bdsh/cmds


Ignore:
Timestamp:
2017-04-03T21:15:17Z (7 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8fe46a0
Parents:
ea4a3f0
Message:

Let vfs_link() and vfs_link_path() return the linked file handle

Add an output argument to both vfs_link() and vfs_link_path() so that the
client may receive the file handle of the linked file or directory. This
makes it easy to work with the new file or directory as it is ready to be
opened or in case of a directory to use it as a parent for further
operations without the need for additional vfs_lookup().

Location:
uspace/app/bdsh/cmds/modules
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/modules/cp/cp.c

    rea4a3f0 ra6fc88a  
    294294                                merge_paths(dest_path, PATH_MAX, src_dirname);
    295295
    296                                 if (vfs_link_path(dest_path, KIND_DIRECTORY) != EOK) {
     296                                if (vfs_link_path(dest_path, KIND_DIRECTORY,
     297                                    NULL) != EOK) {
    297298                                        printf("Unable to create "
    298299                                            "dest directory %s\n", dest_path);
     
    308309                         * e.g. cp -r /src /data/new_dir_src
    309310                         */
    310                         if (vfs_link_path(dest_path, KIND_DIRECTORY) != EOK) {
     311                        if (vfs_link_path(dest_path, KIND_DIRECTORY,
     312                            NULL) != EOK) {
    311313                                printf("Unable to create "
    312314                                    "dest directory %s\n", dest_path);
  • uspace/app/bdsh/cmds/modules/mkdir/mkdir.c

    rea4a3f0 ra6fc88a  
    9696
    9797        if (!create_parents) {
    98                 ret = vfs_link_path(path, KIND_DIRECTORY);
     98                ret = vfs_link_path(path, KIND_DIRECTORY, NULL);
    9999                if (ret != EOK) {
    100100                        cli_error(CL_EFAIL, "%s: could not create %s (%s)",
     
    135135                        path[prev_off] = 0;
    136136
    137                         ret = vfs_link_path(path, KIND_DIRECTORY);
     137                        ret = vfs_link_path(path, KIND_DIRECTORY, NULL);
    138138                        if (ret != EOK && ret != EEXIST) {
    139139                                cli_error(CL_EFAIL, "%s: could not create %s (%s)",
     
    146146                }
    147147                /* Create the final directory. */
    148                 ret = vfs_link_path(path, KIND_DIRECTORY);
     148                ret = vfs_link_path(path, KIND_DIRECTORY, NULL);
    149149                if (ret != EOK) {
    150150                        cli_error(CL_EFAIL, "%s: could not create %s (%s)",
Note: See TracChangeset for help on using the changeset viewer.