[git commit future] open64.c: no need for separate cancellation, open handles it already

Peter S. Mazinger ps.m at gmx.net
Wed Apr 20 10:50:38 UTC 2011


commit: http://git.uclibc.org/uClibc/commit/?id=7b25ef37b275e5e34a4fa40973a387dbc4e61b68
branch: http://git.uclibc.org/uClibc/commit/?id=refs/heads/future

Signed-off-by: Peter S. Mazinger <ps.m at gmx.net>
---
 libc/sysdeps/linux/common/open64.c |   51 ++++++++++--------------------------
 1 files changed, 14 insertions(+), 37 deletions(-)

diff --git a/libc/sysdeps/linux/common/open64.c b/libc/sysdeps/linux/common/open64.c
index 91931fa..bbb12cd 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();
-- 
1.7.3.4



More information about the uClibc-cvs mailing list