Changes in uspace/lib/posix/source/fcntl.c [0d0b319:582a0b8] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/source/fcntl.c
r0d0b319 r582a0b8 40 40 41 41 #include "libc/vfs/vfs.h" 42 43 #include <errno.h> 42 #include "posix/errno.h" 44 43 45 44 /** … … 104 103 int posix_open(const char *pathname, int posix_flags, ...) 105 104 { 105 int rc; 106 106 posix_mode_t posix_mode = 0; 107 107 if (posix_flags & O_CREAT) { … … 135 135 ((posix_flags & O_APPEND) ? MODE_APPEND : 0); 136 136 137 int file; 138 139 if (failed(vfs_lookup(pathname, flags, &file))) 137 int file = rcerrno(vfs_lookup, pathname, flags); 138 if (file < 0) 140 139 return -1; 141 140 142 if (failed(vfs_open(file, mode))) { 141 rc = rcerrno(vfs_open, file, mode); 142 if (rc != EOK) { 143 143 vfs_put(file); 144 144 return -1; … … 147 147 if (posix_flags & O_TRUNC) { 148 148 if (posix_flags & (O_RDWR | O_WRONLY)) { 149 if (failed(vfs_resize(file, 0))) { 149 rc = rcerrno(vfs_resize, file, 0); 150 if (rc != EOK) { 150 151 vfs_put(file); 151 152 return -1;
Note:
See TracChangeset
for help on using the changeset viewer.