Changeset d96d9bc in mainline for uspace/app/bdsh/cmds
- Timestamp:
- 2017-04-02T20:38:50Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c23275a
- Parents:
- 1e2e5795
- Location:
- uspace/app/bdsh/cmds
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/builtins/cd/cd.c
r1e2e5795 rd96d9bc 29 29 #include <stdio.h> 30 30 #include <stdlib.h> 31 #include <unistd.h>32 31 #include <str.h> 33 32 #include <errno.h> 33 #include <vfs/vfs.h> 34 34 35 35 #include "util.h" … … 51 51 static bool previous_directory_set = false; 52 52 53 static int chdir_and_remember(const char *new_dir) { 53 static int chdir_and_remember(const char *new_dir) 54 { 54 55 55 char *ok = getcwd(previous_directory_tmp, PATH_MAX);56 previous_directory_valid = ok != NULL;56 int rc = vfs_cwd_get(previous_directory_tmp, PATH_MAX); 57 previous_directory_valid = (rc == EOK); 57 58 previous_directory_set = true; 58 59 59 if (chdir(new_dir) != 0) 60 return errno; 60 rc = vfs_cwd_set(new_dir); 61 if (rc != EOK) 62 return rc; 61 63 62 64 str_cpy(previous_directory, PATH_MAX, previous_directory_tmp); -
uspace/app/bdsh/cmds/modules/ls/ls.c
r1e2e5795 rd96d9bc 34 34 #include <stdio.h> 35 35 #include <stdlib.h> 36 #include <unistd.h>37 36 #include <dirent.h> 38 37 #include <getopt.h> … … 387 386 388 387 if (argc == 0) { 389 if ( getcwd(de.name, PATH_MAX) == NULL) {388 if (vfs_cwd_get(de.name, PATH_MAX) != EOK) { 390 389 cli_error(CL_EFAIL, "%s: Failed determining working " 391 390 "directory", cmdname); -
uspace/app/bdsh/cmds/modules/mkdir/mkdir.c
r1e2e5795 rd96d9bc 208 208 209 209 if (follow && (argv[optind] != NULL)) { 210 if ( chdir(argv[optind]) != 0)210 if (vfs_cwd_set(argv[optind]) != EOK) 211 211 printf("%s: Error switching to directory.", cmdname); 212 212 } -
uspace/app/bdsh/cmds/modules/pwd/pwd.c
r1e2e5795 rd96d9bc 30 30 #include <stdlib.h> 31 31 #include <mem.h> 32 #include <vfs/vfs.h> 33 #include <abi/errno.h> 32 34 33 35 #include "config.h" … … 57 59 memset(buff, 0, PATH_MAX); 58 60 59 if ( getcwd(buff, PATH_MAX) == NULL) {61 if (vfs_cwd_get(buff, PATH_MAX) != EOK) { 60 62 cli_error(CL_EFAIL, 61 63 "Unable to determine the current working directory"); -
uspace/app/bdsh/cmds/modules/rm/rm.c
r1e2e5795 rd96d9bc 30 30 #include <stdio.h> 31 31 #include <stdlib.h> 32 #include <unistd.h>33 32 #include <dirent.h> 34 33 #include <getopt.h> … … 110 109 memset(rm->cwd, 0, PATH_MAX); 111 110 112 chdir(".");113 114 if ( NULL == (getcwd(rm->owd, PATH_MAX)))111 vfs_cwd_set("."); 112 113 if (EOK != vfs_cwd_get(rm->owd, PATH_MAX)) 115 114 return 0; 116 115
Note:
See TracChangeset
for help on using the changeset viewer.