summaryrefslogtreecommitdiffstats
path: root/libc/stdio/tmpfile.c
diff options
context:
space:
mode:
author"Steven J. Hill" <sjhill@realitydiluted.com>2006-08-23 03:19:32 +0000
committer"Steven J. Hill" <sjhill@realitydiluted.com>2006-08-23 03:19:32 +0000
commit71c1f8a3e7f3d681360874de732257b62a800798 (patch)
treeb817f80c37547f98c21282bcf6996c609ebe66fe /libc/stdio/tmpfile.c
parentaa39b0b2f79973652cbe219eaf580dd02bfb6670 (diff)
downloaduClibc-alpine-71c1f8a3e7f3d681360874de732257b62a800798.tar.bz2
uClibc-alpine-71c1f8a3e7f3d681360874de732257b62a800798.tar.xz
Bring in remaining futex support for stdio.
Diffstat (limited to 'libc/stdio/tmpfile.c')
-rw-r--r--libc/stdio/tmpfile.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libc/stdio/tmpfile.c b/libc/stdio/tmpfile.c
index f83944539..f268d58cc 100644
--- a/libc/stdio/tmpfile.c
+++ b/libc/stdio/tmpfile.c
@@ -20,10 +20,16 @@
#include <stdio.h>
#include <unistd.h>
#include "../misc/internals/tempname.h"
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+#include <errno.h>
+#include <not-cancel.h>
+#endif
libc_hidden_proto(fdopen)
libc_hidden_proto(remove)
+#ifndef __UCLIBC_HAS_THREADS_NATIVE__
libc_hidden_proto(close)
+#endif
/* This returns a new stream opened on a temporary file (generated
by tmpnam). The file is opened with mode "w+b" (binary read/write).
@@ -46,7 +52,11 @@ FILE * tmpfile (void)
(void) remove (buf);
if ((f = fdopen (fd, "w+b")) == NULL)
+#ifdef __UCLIBC_HAS_THREADS_NATIVE__
+ close_not_cancel (fd);
+#else
close (fd);
+#endif
return f;
}