From 2fe6579125fe042f2255afbf00fc8e4b80d6a6be Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Tue, 27 May 2014 00:44:23 -0400 Subject: overhaul tmpfile, tmpnam, and tempnam functions these all now use the shared __randname function internally, rather than duplicating logic for producing a random name. incorrect usage of the access syscall (which works with real uid/gid, not effective) has been removed, along with unnecessary heavy dependencies like snprintf. --- src/stdio/tmpfile.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/stdio/tmpfile.c') diff --git a/src/stdio/tmpfile.c b/src/stdio/tmpfile.c index b0d0ba07..c8569948 100644 --- a/src/stdio/tmpfile.c +++ b/src/stdio/tmpfile.c @@ -1,19 +1,19 @@ #include #include -#include #include "stdio_impl.h" #define MAXTRIES 100 +char *__randname(char *); + FILE *tmpfile(void) { - char buf[L_tmpnam], *s; + char s[] = "/tmp/tmpfile_XXXXXX"; int fd; FILE *f; int try; for (try=0; try= 0) { f = __fdopen(fd, "w+"); -- cgit v1.2.1