Changes in uspace/lib/posix/src/unistd.c [4e6a610:7c3fb9b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/src/unistd.c
r4e6a610 r7c3fb9b 39 39 #include <errno.h> 40 40 41 #include "posix/dirent.h"42 41 #include "posix/string.h" 43 #include "posix/sys/types.h"44 42 #include "posix/fcntl.h" 45 43 … … 53 51 54 52 // FIXME: replace with a hash table 55 aoff64_t posix_pos[ VFS_MAX_OPEN_FILES];53 aoff64_t posix_pos[MAX_OPEN_FILES]; 56 54 57 55 /* Array of environment variable strings (NAME=VALUE). */ … … 370 368 */ 371 369 int fd = open(path, O_RDONLY); 372 if (fd >= 0) { 373 close(fd); 374 return 0; 375 } 376 DIR *dir = opendir(path); 377 if (dir != NULL) { 378 closedir(dir); 379 return 0; 380 } 381 return -1; 370 if (fd < 0) 371 return -1; 372 close(fd); 373 return 0; 382 374 } else { 383 375 /* Invalid amode argument. */
Note:
See TracChangeset
for help on using the changeset viewer.