Changeset 368ee04 in mainline for uspace/app/bdsh/cmds/modules/mkdir/mkdir.c
- Timestamp:
- 2017-04-05T18:10:39Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 93ad8166
- Parents:
- 39f892a9 (diff), 2166728 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/mkdir/mkdir.c
r39f892a9 r368ee04 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.