Changeset 23a0368 in mainline for uspace/app/bdsh/cmds
- Timestamp:
- 2017-03-30T19:52:23Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ae7bfbbd
- Parents:
- b5b5d84
- Location:
- uspace/app/bdsh/cmds/modules
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/cat/cat.c
rb5b5d84 r23a0368 31 31 #include <stdlib.h> 32 32 #include <unistd.h> 33 #include <sys/stat.h>34 33 #include <getopt.h> 35 34 #include <str.h> … … 214 213 struct stat st; 215 214 216 if ( fstat(fd, &st) != EOK) {215 if (vfs_stat(fd, &st) != EOK) { 217 216 close(fd); 218 217 free(buff); 219 printf("Unable to fstat %d\n", fd);218 printf("Unable to vfs_stat %d\n", fd); 220 219 return 1; 221 220 } -
uspace/app/bdsh/cmds/modules/cp/cp.c
rb5b5d84 r23a0368 37 37 #include <fcntl.h> 38 38 #include <sys/stat.h> 39 #include <vfs/vfs.h> 39 40 #include <dirent.h> 40 41 #include "config.h" … … 83 84 struct stat s; 84 85 85 int r = stat(path, &s);86 87 if (r != 0)86 int r = vfs_stat_path(path, &s); 87 88 if (r != EOK) 88 89 return TYPE_NONE; 89 90 else if (s.is_directory) … … 341 342 342 343 /* Check if we are copying a directory into itself */ 343 stat(src_dent, &src_s);344 stat(dest_path, &dest_s);344 vfs_stat_path(src_dent, &src_s); 345 vfs_stat_path(dest_path, &dest_s); 345 346 346 347 if (dest_s.index == src_s.index && … … 394 395 } 395 396 396 if ( fstat(fd1, &st) != EOK) {397 if (vfs_stat(fd1, &st) != EOK) { 397 398 printf("Unable to fstat %d\n", fd1); 398 399 close(fd1); -
uspace/app/bdsh/cmds/modules/ls/ls.c
rb5b5d84 r23a0368 39 39 #include <getopt.h> 40 40 #include <sys/types.h> 41 #include < sys/stat.h>41 #include <vfs/vfs.h> 42 42 #include <str.h> 43 43 #include <sort.h> … … 185 185 buff[len] = '\0'; 186 186 187 rc = stat(buff, &tosort[nbdirs++].s);188 if (rc != 0) {187 rc = vfs_stat_path(buff, &tosort[nbdirs++].s); 188 if (rc != EOK) { 189 189 printf("ls: skipping bogus node %s\n", buff); 190 printf("error=%d\n", errno);190 printf("error=%d\n", rc); 191 191 goto out; 192 192 } … … 315 315 static unsigned int ls_scope(const char *path, struct dir_elem_t *de) 316 316 { 317 if ( stat(path, &de->s) != 0) {317 if (vfs_stat_path(path, &de->s) != EOK) { 318 318 cli_error(CL_ENOENT, "%s", path); 319 319 return LS_BOGUS; -
uspace/app/bdsh/cmds/modules/ls/ls.h
rb5b5d84 r23a0368 1 1 #ifndef LS_H 2 2 #define LS_H 3 4 #include <vfs/vfs.h> 3 5 4 6 /* Various values that can be returned by ls_scope() */ -
uspace/app/bdsh/cmds/modules/touch/touch.c
rb5b5d84 r23a0368 40 40 #include <str.h> 41 41 #include <getopt.h> 42 #include <sys/stat.h>43 42 #include <errno.h> 43 #include <vfs/vfs.h> 44 44 45 45 #include "config.h" … … 123 123 124 124 /* Check whether file exists if -c (--no-create) option is given */ 125 if ((!no_create) || ((no_create) && (stat(buff, &file_stat) == 0))) 125 if ((!no_create) || 126 ((no_create) && (vfs_stat_path(buff, &file_stat) == EOK))) { 126 127 fd = open(buff, O_RDWR | O_CREAT); 128 } 127 129 128 130 if (fd < 0) {
Note:
See TracChangeset
for help on using the changeset viewer.