Changeset 368ee04 in mainline for uspace/app/bdsh/cmds/modules/touch/touch.c
- Timestamp:
- 2017-04-05T18:10:39Z (8 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/bdsh/cmds/modules/touch/touch.c
r39f892a9 r368ee04 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.