diff options
Diffstat (limited to 'stdio-common/tmpfile64.c')
-rw-r--r-- | stdio-common/tmpfile64.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/stdio-common/tmpfile64.c b/stdio-common/tmpfile64.c index a7fce66a86..0f3a0044a4 100644 --- a/stdio-common/tmpfile64.c +++ b/stdio-common/tmpfile64.c @@ -19,8 +19,9 @@ #include <stdio.h> #include <unistd.h> -#ifdef _USE_IN_LIBIO -# define fdopen _IO_new_fdopen +#ifdef USE_IN_LIBIO +# include <iolibio.h> +# define __fdopen _IO_fdopen #endif /* This returns a new stream opened on a temporary file (generated @@ -36,15 +37,16 @@ tmpfile64 () if (__path_search (buf, FILENAME_MAX, NULL, "tmpf")) return NULL; - if ((fd = __gen_tempname (buf, 1, 1)) < 0) + fd = __gen_tempname (buf, 1, 1); + if (fd < 0) return NULL; /* Note that this relies on the Unix semantics that a file is not really removed until it is closed. */ (void) remove (buf); - if ((f = fdopen (fd, "w+b")) == NULL) - close (fd); + if ((f = __fdopen (fd, "w+b")) == NULL) + __close (fd); return f; } |