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