summaryrefslogtreecommitdiff
path: root/libc
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2011-04-21 22:09:59 +0200
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2012-06-15 14:00:40 +0200
commit15f25e33d983dabb1b6df202cf09f9f2b39c02f2 (patch)
tree15d333a88717908e59d1e10460557e6bda3fe91f /libc
parent2c917b0305102f3e01e825406f0e15cd95560312 (diff)
open64.c: no need for separate cancellation, open handles it already
Signed-off-by: Peter S. Mazinger <ps.m@gmx.net> Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'libc')
-rw-r--r--libc/sysdeps/linux/common/open64.c51
1 files changed, 14 insertions, 37 deletions
diff --git a/libc/sysdeps/linux/common/open64.c b/libc/sysdeps/linux/common/open64.c
index 91931fa70..bbb12cd1a 100644
--- a/libc/sysdeps/linux/common/open64.c
+++ b/libc/sysdeps/linux/common/open64.c
@@ -7,47 +7,24 @@
#include <_lfs_64.h>
#include <fcntl.h>
#include <stdarg.h>
-#ifdef __UCLIBC_HAS_THREADS_NATIVE__
-#include <errno.h>
-#include <sysdep-cancel.h>
-#endif
-
-#ifndef O_LARGEFILE
-# define O_LARGEFILE 0100000
-#endif
+#include <cancel.h>
/* Open FILE with access OFLAG. If OFLAG includes O_CREAT,
a third argument is the file protection. */
-int open64 (const char *file, int oflag, ...)
+int open64(const char *file, int oflag, ...)
{
- mode_t mode = 0;
-
- if (oflag & O_CREAT)
- {
- va_list arg;
- va_start (arg, oflag);
- mode = va_arg (arg, mode_t);
- va_end (arg);
- }
-
-#ifdef __UCLIBC_HAS_THREADS_NATIVE__
- if (SINGLE_THREAD_P)
- return INLINE_SYSCALL (open, 3, file, oflag | O_LARGEFILE, mode);
-
- int oldtype = LIBC_CANCEL_ASYNC ();
-
- int result = INLINE_SYSCALL (open, 3, file, oflag | O_LARGEFILE, mode);
+ mode_t mode = 0;
- LIBC_CANCEL_RESET (oldtype);
+ if (oflag & O_CREAT) {
+ va_list arg;
+ va_start (arg, oflag);
+ mode = va_arg (arg, mode_t);
+ va_end (arg);
+ }
- return result;
-#else
- return open(file, oflag | O_LARGEFILE, mode);
-#endif
+ return open(file, oflag | O_LARGEFILE, mode);
}
-#ifndef __LINUXTHREADS_OLD__
-libc_hidden_def(open64)
-#else
-libc_hidden_weak(open64)
-strong_alias(open64,__libc_open64)
-#endif
+lt_strong_alias(open64)
+lt_libc_hidden(open64)
+/* open handled cancellation, noop on uClibc */
+LIBC_CANCEL_HANDLED();