Changeset 4e6a610 in mainline for uspace/lib/posix/src/unistd.c
- Timestamp:
- 2018-06-25T09:54:28Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bfe90b6
- Parents:
- fb0ec570
- git-author:
- Jiri Svoboda <jiri@…> (2018-06-24 17:51:54)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-06-25 09:54:28)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/posix/src/unistd.c
rfb0ec570 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 … … 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.