Ignore:
Timestamp:
2017-04-05T18:10:39Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
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.
Message:

Merge from lp:~jakub/helenos/vfs-2.5-cherrypick

This merge cherry-picks some of the changesets from Jiri Zarevucky's:

lp:~zarevucky-jiri/helenos/vfs-2.5

and then continues independently, yet sometime in a similar vein.

Roughly speaking, Jiri's branch is merged entirely up to its revision
1926 and then cherry-picked on and off until its revision 1965. Among
these changes are:

  • relativization of the API,
  • client-side roots,
  • server-side mounts,
  • inbox for passing arbitrary files from parent to child,
  • some streamlining and cleanup.

Additional changes include:

  • addressing issues introduced by the above changes,
  • client-side I/O cursors (file positions),
  • all HelenOS file system APIs begin with the vfs_ prefix and can be used after including vfs/vfs.h,
  • removal of some POSIX-ish headers and definitions,
  • additional cleanup.
File:
1 edited

Legend:

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

    r39f892a9 r368ee04  
    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.