Ignore:
File:
1 edited

Legend:

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

    r6afc9d7 ra6fc88a  
    3030#include <stdlib.h>
    3131#include <dirent.h>
    32 #include <fcntl.h>
    3332#include <sys/types.h>
    34 #include <sys/stat.h>
    3533#include <getopt.h>
    3634#include <stdarg.h>
     
    9896
    9997        if (!create_parents) {
    100                 if (mkdir(path, 0) != 0) {
     98                ret = vfs_link_path(path, KIND_DIRECTORY, NULL);
     99                if (ret != EOK) {
    101100                        cli_error(CL_EFAIL, "%s: could not create %s (%s)",
    102                             cmdname, path, str_error(errno));
     101                            cmdname, path, str_error(ret));
    103102                        ret = 1;
    104103                }
     
    136135                        path[prev_off] = 0;
    137136
    138                         if (mkdir(path, 0) != 0 && errno != EEXIST) {
     137                        ret = vfs_link_path(path, KIND_DIRECTORY, NULL);
     138                        if (ret != EOK && ret != EEXIST) {
    139139                                cli_error(CL_EFAIL, "%s: could not create %s (%s)",
    140                                     cmdname, path, str_error(errno));
     140                                    cmdname, path, str_error(ret));
    141141                                ret = 1;
    142142                                goto leave;
     
    146146                }
    147147                /* Create the final directory. */
    148                 if (mkdir(path, 0) != 0) {
     148                ret = vfs_link_path(path, KIND_DIRECTORY, NULL);
     149                if (ret != EOK) {
    149150                        cli_error(CL_EFAIL, "%s: could not create %s (%s)",
    150                             cmdname, path, str_error(errno));
     151                            cmdname, path, str_error(ret));
    151152                        ret = 1;
    152153                }
     
    207208
    208209        if (follow && (argv[optind] != NULL)) {
    209                 if (chdir(argv[optind]) != 0)
     210                if (vfs_cwd_set(argv[optind]) != EOK)
    210211                        printf("%s: Error switching to directory.", cmdname);
    211212        }
Note: See TracChangeset for help on using the changeset viewer.