diff options
author | Austin Foxley <austinf@cetoncorp.com> | 2009-09-21 18:25:22 -0700 |
---|---|---|
committer | Austin Foxley <austinf@cetoncorp.com> | 2009-09-21 18:25:22 -0700 |
commit | e2784760e51ec0de62bbee61d27a85147460ece0 (patch) | |
tree | 0d1541dc5f16424d5a097929e0aaaa8c762a1056 /libc/misc/dirent/opendir.c | |
parent | a894902293392cdae3a614ae3ff065ca3a7b9f75 (diff) | |
download | uClibc-alpine-e2784760e51ec0de62bbee61d27a85147460ece0.tar.bz2 uClibc-alpine-e2784760e51ec0de62bbee61d27a85147460ece0.tar.xz |
not-cancel: use *_not_cancel variants directly
add a no threads version of not-cancel.h to fallback on
Signed-off-by: Austin Foxley <austinf@cetoncorp.com>
Diffstat (limited to 'libc/misc/dirent/opendir.c')
-rw-r--r-- | libc/misc/dirent/opendir.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/libc/misc/dirent/opendir.c b/libc/misc/dirent/opendir.c index a2cfd5197..c2e008a3a 100644 --- a/libc/misc/dirent/opendir.c +++ b/libc/misc/dirent/opendir.c @@ -12,9 +12,7 @@ #include <unistd.h> #include <sys/dir.h> #include <sys/stat.h> -#ifdef __UCLIBC_HAS_THREADS_NATIVE__ #include <not-cancel.h> -#endif #include <dirent.h> #include "dirstream.h" @@ -89,11 +87,7 @@ DIR *opendir(const char *name) # define O_CLOEXEC 0 #endif -#ifdef __UCLIBC_HAS_THREADS_NATIVE__ fd = open_not_cancel_2(name, O_RDONLY|O_NDELAY|O_DIRECTORY|O_CLOEXEC); -#else - fd = open(name, O_RDONLY|O_NDELAY|O_DIRECTORY|O_CLOEXEC); -#endif if (fd < 0) return NULL; /* Note: we should check to make sure that between the stat() and open() @@ -105,11 +99,7 @@ DIR *opendir(const char *name) /* this close() never fails *int saved_errno; *saved_errno = errno; */ -#ifdef __UCLIBC_HAS_THREADS_NATIVE__ close_not_cancel_no_status(fd); -#else - close(fd); -#endif /*__set_errno(saved_errno);*/ return NULL; } @@ -123,11 +113,7 @@ DIR *opendir(const char *name) ptr = fd_to_DIR(fd, statbuf.st_blksize); if (!ptr) { -#ifdef __UCLIBC_HAS_THREADS_NATIVE__ close_not_cancel_no_status(fd); -#else - close(fd); -#endif __set_errno(ENOMEM); } return ptr; |