Changes in uspace/app/bdsh/cmds/modules/mkdir/mkdir.c [6afc9d7:a6fc88a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/mkdir/mkdir.c
r6afc9d7 ra6fc88a 30 30 #include <stdlib.h> 31 31 #include <dirent.h> 32 #include <fcntl.h>33 32 #include <sys/types.h> 34 #include <sys/stat.h>35 33 #include <getopt.h> 36 34 #include <stdarg.h> … … 98 96 99 97 if (!create_parents) { 100 if (mkdir(path, 0) != 0) { 98 ret = vfs_link_path(path, KIND_DIRECTORY, NULL); 99 if (ret != EOK) { 101 100 cli_error(CL_EFAIL, "%s: could not create %s (%s)", 102 cmdname, path, str_error( errno));101 cmdname, path, str_error(ret)); 103 102 ret = 1; 104 103 } … … 136 135 path[prev_off] = 0; 137 136 138 if (mkdir(path, 0) != 0 && errno != EEXIST) { 137 ret = vfs_link_path(path, KIND_DIRECTORY, NULL); 138 if (ret != EOK && ret != EEXIST) { 139 139 cli_error(CL_EFAIL, "%s: could not create %s (%s)", 140 cmdname, path, str_error( errno));140 cmdname, path, str_error(ret)); 141 141 ret = 1; 142 142 goto leave; … … 146 146 } 147 147 /* Create the final directory. */ 148 if (mkdir(path, 0) != 0) { 148 ret = vfs_link_path(path, KIND_DIRECTORY, NULL); 149 if (ret != EOK) { 149 150 cli_error(CL_EFAIL, "%s: could not create %s (%s)", 150 cmdname, path, str_error( errno));151 cmdname, path, str_error(ret)); 151 152 ret = 1; 152 153 } … … 207 208 208 209 if (follow && (argv[optind] != NULL)) { 209 if ( chdir(argv[optind]) != 0)210 if (vfs_cwd_set(argv[optind]) != EOK) 210 211 printf("%s: Error switching to directory.", cmdname); 211 212 }
Note:
See TracChangeset
for help on using the changeset viewer.