Changes in uspace/app/bdsh/cmds/modules/touch/touch.c [6afc9d7:9c4cf0d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/touch/touch.c
r6afc9d7 r9c4cf0d 35 35 #include <stdlib.h> 36 36 #include <unistd.h> 37 #include <fcntl.h>38 37 #include <dirent.h> 39 38 #include <sys/types.h> 40 39 #include <str.h> 41 40 #include <getopt.h> 42 #include <sys/stat.h>43 41 #include <errno.h> 42 #include <vfs/vfs.h> 44 43 45 44 #include "config.h" … … 123 122 124 123 /* Check whether file exists if -c (--no-create) option is given */ 125 if ((!no_create) || ((no_create) && (stat(buff, &file_stat) == 0))) 126 fd = open(buff, O_RDWR | O_CREAT); 124 if ((!no_create) || 125 ((no_create) && (vfs_stat_path(buff, &file_stat) == EOK))) { 126 fd = vfs_lookup(buff, WALK_REGULAR | WALK_MAY_CREATE); 127 } 127 128 128 129 if (fd < 0) { … … 132 133 continue; 133 134 } else { 134 close(fd);135 vfs_put(fd); 135 136 fd = -1; 136 137 }
Note:
See TracChangeset
for help on using the changeset viewer.