Ignore:
Timestamp:
2015-11-02T20:54:19Z (10 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d8513177
Parents:
3feeab2 (diff), 5265eea4 (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.
Message:

Merge mainline changes.

File:
1 edited

Legend:

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

    r3feeab2 rff381a7  
    8989{
    9090        /* Ensure we would always work with absolute and canonified path. */
    91         char *path = absolutize(user_path, NULL);
     91        char *path = vfs_absolutize(user_path, NULL);
    9292        if (path == NULL) {
    9393                cli_error(CL_ENOMEM, "%s: path too big?", cmdname);
     
    9595        }
    9696
    97         int rc;
    9897        int ret = 0;
    9998
    10099        if (!create_parents) {
    101                 rc = mkdir(path, 0);
    102                 if (rc != EOK) {
     100                if (mkdir(path, 0) != 0) {
    103101                        cli_error(CL_EFAIL, "%s: could not create %s (%s)",
    104                             cmdname, path, str_error(rc));
     102                            cmdname, path, str_error(errno));
    105103                        ret = 1;
    106104                }
     
    137135                        char slash_char = path[prev_off];
    138136                        path[prev_off] = 0;
    139                         rc = mkdir(path, 0);
    140                         if (rc == EEXIST) {
    141                                 rc = EOK;
    142                         }
    143 
    144                         if (rc != EOK) {
     137
     138                        if (mkdir(path, 0) != 0 && errno != EEXIST) {
    145139                                cli_error(CL_EFAIL, "%s: could not create %s (%s)",
    146                                     cmdname, path, str_error(rc));
     140                                    cmdname, path, str_error(errno));
    147141                                ret = 1;
    148142                                goto leave;
     
    152146                }
    153147                /* Create the final directory. */
    154                 rc = mkdir(path, 0);
    155                 if (rc != EOK) {
     148                if (mkdir(path, 0) != 0) {
    156149                        cli_error(CL_EFAIL, "%s: could not create %s (%s)",
    157                             cmdname, path, str_error(rc));
     150                            cmdname, path, str_error(errno));
    158151                        ret = 1;
    159152                }
     
    214207
    215208        if (follow && (argv[optind] != NULL)) {
    216                 chdir(argv[optind]);
     209                if (chdir(argv[optind]) != 0)
     210                        printf("%s: Error switching to directory.", cmdname);
    217211        }
    218212
Note: See TracChangeset for help on using the changeset viewer.