about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-10-01 21:21:46 +0000
committerUlrich Drepper <drepper@redhat.com>2007-10-01 21:21:46 +0000
commit035ef8d75735b3cee4daa87f17abe682551a1a9f (patch)
tree366543543b31794b7380ddc5b59c4ab10f222924
parenta7f573e5dc8de60d469d17622adb9a0697a1be32 (diff)
downloadglibc-035ef8d75735b3cee4daa87f17abe682551a1a9f.tar.gz
glibc-035ef8d75735b3cee4daa87f17abe682551a1a9f.tar.xz
glibc-035ef8d75735b3cee4daa87f17abe682551a1a9f.zip
* include/stdio_ext.h (__fsetlocking): Define as macro.
-rw-r--r--ChangeLog4
-rw-r--r--include/stdio_ext.h17
2 files changed, 18 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index d76ca475ff..3c6cb57c98 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2007-10-01  Ulrich Drepper  <drepper@redhat.com>
+
+	* include/stdio_ext.h (__fsetlocking): Define as macro.
+
 2007-09-30  Ulrich Drepper  <drepper@redhat.com>
 
 	* locale/programs/ld-collate.c (collate_finish): Compare all bytes
diff --git a/include/stdio_ext.h b/include/stdio_ext.h
index 31c7a4e7a1..c7b77246b7 100644
--- a/include/stdio_ext.h
+++ b/include/stdio_ext.h
@@ -4,8 +4,19 @@
 
 extern int __fsetlocking_internal (FILE *__fp, int __type) attribute_hidden;
 
-#ifndef NOT_IN_libc
-# define __fsetlocking(fp, type) INTUSE(__fsetlocking) (fp, type)
-#endif
+#define __fsetlocking(fp, type) \
+  ({ int __result = ((fp->_flags & _IO_USER_LOCK)			\
+		     ? FSETLOCKING_BYCALLER : FSETLOCKING_INTERNAL);	\
+									\
+     if (type != FSETLOCKING_QUERY)					\
+       {								\
+	 fp->_flags &= ~_IO_USER_LOCK;					\
+	 if (type == FSETLOCKING_BYCALLER)				\
+	   fp->_flags |= _IO_USER_LOCK;					\
+       }								\
+									\
+     __result;								\
+  })
+
 
 #endif