Ignore:
Timestamp:
2017-03-31T19:57:38Z (7 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
80743a1
Parents:
a56cef9
Message:

Introduce vfs_link_path() and replace mkdir() with it

File:
1 edited

Legend:

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

    ra56cef9 r6e5562a  
    3232#include <fcntl.h>
    3333#include <sys/types.h>
    34 #include <sys/stat.h>
    3534#include <getopt.h>
    3635#include <stdarg.h>
     
    9897
    9998        if (!create_parents) {
    100                 if (mkdir(path, 0) != 0) {
     99                ret = vfs_link_path(path, KIND_DIRECTORY);
     100                if (ret != EOK) {
    101101                        cli_error(CL_EFAIL, "%s: could not create %s (%s)",
    102                             cmdname, path, str_error(errno));
     102                            cmdname, path, str_error(ret));
    103103                        ret = 1;
    104104                }
     
    136136                        path[prev_off] = 0;
    137137
    138                         if (mkdir(path, 0) != 0 && errno != EEXIST) {
     138                        ret = vfs_link_path(path, KIND_DIRECTORY);
     139                        if (ret != EOK && ret != EEXIST) {
    139140                                cli_error(CL_EFAIL, "%s: could not create %s (%s)",
    140                                     cmdname, path, str_error(errno));
     141                                    cmdname, path, str_error(ret));
    141142                                ret = 1;
    142143                                goto leave;
     
    146147                }
    147148                /* Create the final directory. */
    148                 if (mkdir(path, 0) != 0) {
     149                ret = vfs_link_path(path, KIND_DIRECTORY);
     150                if (ret != EOK) {
    149151                        cli_error(CL_EFAIL, "%s: could not create %s (%s)",
    150                             cmdname, path, str_error(errno));
     152                            cmdname, path, str_error(ret));
    151153                        ret = 1;
    152154                }
Note: See TracChangeset for help on using the changeset viewer.