From 15f25e33d983dabb1b6df202cf09f9f2b39c02f2 Mon Sep 17 00:00:00 2001
From: "Peter S. Mazinger" <ps.m@gmx.net>
Date: Thu, 21 Apr 2011 22:09:59 +0200
Subject: 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>
---
 libc/sysdeps/linux/common/open64.c | 51 +++++++++++---------------------------
 1 file 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();
-- 
cgit v1.2.3