From 7cabd57c0d64a2ee5ca0c5218c877ff700727880 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 3 Aug 1998 16:47:01 +0000 Subject: Update. 1998-08-03 16:36 Ulrich Drepper * catgets/catgets.c: Use mmap/munmap only is _POSIX_MAPPED_FILES is defined. * catgets/open_catalog.c: Likewise. * iconv/iconv_prog.c: Likewise. * intl/loadmsgcat.c: Likewise. * locale/findlocale.c: Likewise. * locale/loadlocale.c: Likewise. * locale/programs/localedef.c: Likewise. * malloc/malloc.c: Likewise. * elf/elf.h: Fix typo. * math/Makefile: Use $(LN_S) instead of ln. * sysdeps/generic/getpgid.c: Fix return type. 1998-08-01 02:49 -0400 Zack Weinberg * sysdeps/posix/tempname.c (__stdio_gen_tempname): Rename to __gen_tempname and simplify the interface. Strip out the code to do path search and create FILE objects. This function now takes a mktemp() style template and returns either a name or a file descriptor. (__path_search): New function; searches for directories for temp files. * sysdeps/generic/tempname.c: Stub out __gen_tempname and __path_search, not __stdio_gen_tempname. * libio/stdio.h: Prototype __gen_tempname and __path_search, not __stdio_gen_tempname. * stdio/stdio.h: Likewise. * stdio-common/tempnam.c: Use __path_search and __gen_tempname. * stdio-common/tmpfile.c: Likewise. * stdio-common/tmpfile64.c: Likewise. * stdio-common/tmpnam.c: Likewise. * stdio-common/tmpnam_r.c: Likewise. * misc/mkstemp.c: New file. Use __gen_tempname. * misc/mktemp.c: Likewise. * sysdeps/posix/mkstemp.c: Removed. * sysdeps/posix/mktemp.c: Removed. * sysdeps/generic/mkstemp.c: Removed. * sysdeps/generic/mktemp.c: Removed. 1998-08-02 Thorsten Kukuk * configure.in: Check, if door add-on is installed. * config.make.in: Add have_doors. * sunrpc/Makefile: Add HAVE_DOOR define. * sunrpc/key_call.c: Add keyserv/door interface. * sunrpc/svc_unix.c: Call setsockopt only if SO_PASSCRED is defined. * sunrpc/clnt_unix.c: Likewise. 1998-08-02 Andreas Jaeger * inet/netinet/in.h (IN_CLASSC): Correct mask. Reported by Ian Staniforth [fixes PR libc/727]. 1998-08-03 10:23 Ulrich Drepper * misc/Makefile: Fix installation problem with --disable-shared. * posix/Makefile: Likewise. 1998-08-02 Andreas Schwab * posix/regex.c (re_search_2): Optimize searching for anchored pattern if '^' cannot match at embedded newlines. (regerror): Renamed from __regerror, which it should only be called if _LIBC. 1998-07-31 Andreas Schwab * sunrpc/svc_unix.c (__msgread): Check setsockopt return value. 1998-07-31 Andreas Schwab * sysdeps/generic/glob.c: Remove obsolete cast. 1998-07-31 Andreas Schwab * Rules (tests): Fix last change. --- stdio-common/tmpnam.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'stdio-common/tmpnam.c') diff --git a/stdio-common/tmpnam.c b/stdio-common/tmpnam.c index 3389ff57b4..e5c6bf166d 100644 --- a/stdio-common/tmpnam.c +++ b/stdio-common/tmpnam.c @@ -19,7 +19,6 @@ #include #include - /* Generate a unique filename in P_tmpdir. This function is *not* thread safe! */ @@ -30,20 +29,21 @@ tmpnam (char *s) where S != NULL. */ static char buf[L_tmpnam]; char tmpbuf[L_tmpnam]; - char *result; /* In the following call we use the buffer pointed to by S if non-NULL although we don't know the size. But we limit the size - to FILENAME_MAX characters in any case. */ - result = __stdio_gen_tempname (s ?: tmpbuf, L_tmpnam, (const char *) NULL, - (const char *) NULL, 0, - (size_t *) NULL, (FILE **) NULL, 0); + to L_tmpnam characters in any case. */ + if (__path_search (s ? : tmpbuf, L_tmpnam, NULL, NULL)) + return NULL; + + if (__gen_tempname (s ? : tmpbuf, 0, 0)) + return NULL; - if (result != NULL && s == NULL) + if (s == NULL) { - memcpy (buf, result, L_tmpnam); - result = buf; + memcpy (buf, tmpbuf, L_tmpnam); + return buf; } - - return result; + else + return s; } -- cgit v1.2.3