Changeset 23a0368 in mainline for uspace/app
- Timestamp:
- 2017-03-30T19:52:23Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ae7bfbbd
- Parents:
- b5b5d84
- Location:
- uspace/app
- Files:
-
- 9 edited
-
bdsh/cmds/modules/cat/cat.c (modified) (2 diffs)
-
bdsh/cmds/modules/cp/cp.c (modified) (4 diffs)
-
bdsh/cmds/modules/ls/ls.c (modified) (3 diffs)
-
bdsh/cmds/modules/ls/ls.h (modified) (1 diff)
-
bdsh/cmds/modules/touch/touch.c (modified) (2 diffs)
-
bdsh/compl.c (modified) (2 diffs)
-
init/init.c (modified) (2 diffs)
-
sysinst/futil.c (modified) (3 diffs)
-
viewer/viewer.c (modified) (2 diffs)
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) { -
uspace/app/bdsh/compl.c
rb5b5d84 r23a0368 33 33 #include <macros.h> 34 34 #include <stdlib.h> 35 #include < sys/stat.h>35 #include <vfs/vfs.h> 36 36 37 37 #include "cmds/cmds.h" … … 360 360 asprintf(&ent_path, "%s/%s", *cs->path, dent->d_name); 361 361 struct stat ent_stat; 362 if ( stat(ent_path, &ent_stat) != 0) {362 if (vfs_stat_path(ent_path, &ent_stat) != EOK) { 363 363 /* Error */ 364 364 free(ent_path); -
uspace/app/init/init.c
rb5b5d84 r23a0368 42 42 #include <errno.h> 43 43 #include <fcntl.h> 44 #include <sys/stat.h>45 44 #include <task.h> 46 45 #include <malloc.h> … … 156 155 { 157 156 struct stat s; 158 if ( stat(path, &s) != 0) {157 if (vfs_stat_path(path, &s) != EOK) { 159 158 printf("%s: Unable to stat %s\n", NAME, path); 160 159 return ENOENT; -
uspace/app/sysinst/futil.c
rb5b5d84 r23a0368 40 40 #include <stdlib.h> 41 41 #include <sys/stat.h> 42 #include <vfs/vfs.h> 42 43 #include <sys/types.h> 43 44 #include <dirent.h> … … 119 120 return ENOMEM; 120 121 121 rc = stat(srcp, &s);122 rc = vfs_stat_path(srcp, &s); 122 123 if (rc != EOK) 123 124 return EIO; … … 166 167 return ENOENT; 167 168 168 if ( fstat(sf, &st) != EOK) {169 if (vfs_stat(sf, &st) != EOK) { 169 170 close(sf); 170 171 return EIO; -
uspace/app/viewer/viewer.c
rb5b5d84 r23a0368 36 36 #include <unistd.h> 37 37 #include <fcntl.h> 38 #include < sys/stat.h>38 #include <vfs/vfs.h> 39 39 #include <errno.h> 40 40 #include <malloc.h> … … 115 115 116 116 struct stat stat; 117 int rc = fstat(fd, &stat);118 if (rc != 0) {117 int rc = vfs_stat(fd, &stat); 118 if (rc != EOK) { 119 119 close(fd); 120 120 return false;
Note:
See TracChangeset
for help on using the changeset viewer.
