about summary refs log tree commit diff
path: root/stdio-common/tmpnam.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-09-29 02:56:42 +0000
committerUlrich Drepper <drepper@redhat.com>2000-09-29 02:56:42 +0000
commite658b54e8e67c00063a0b549fa25b73d8e6d4076 (patch)
tree2c481b771c920873bdf6977faf071eafda5c39c5 /stdio-common/tmpnam.c
parentee6c5330273edda1ab102ad780d1984aca055e77 (diff)
downloadglibc-e658b54e8e67c00063a0b549fa25b73d8e6d4076.tar.gz
glibc-e658b54e8e67c00063a0b549fa25b73d8e6d4076.tar.xz
glibc-e658b54e8e67c00063a0b549fa25b73d8e6d4076.zip
Update.
	* stdio-common/tmpnam.c (tmpnam): Optimize a bit.

	* sysdeps/posix/getaddrinfo.c (gaih_local): Don't use tmpnam, use
	underlying functions directly.
Diffstat (limited to 'stdio-common/tmpnam.c')
-rw-r--r--stdio-common/tmpnam.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/stdio-common/tmpnam.c b/stdio-common/tmpnam.c
index c202760af2..fc30026648 100644
--- a/stdio-common/tmpnam.c
+++ b/stdio-common/tmpnam.c
@@ -29,15 +29,17 @@ tmpnam (char *s)
 {
   /* By using two buffers we manage to be thread safe in the case
      where S != NULL.  */
-  char tmpbuf[L_tmpnam];
+  char tmpbufmem[L_tmpnam];
+  char tmpbuf = s ?: tmpbufmem;
 
   /* 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 L_tmpnam characters in any case.  */
-  if (__path_search (s ? : tmpbuf, L_tmpnam, NULL, NULL, 0))
+  if (__builtin_expect (__path_search (tmpbuf, L_tmpnam, NULL, NULL, 0),
+			0))
     return NULL;
 
-  if (__gen_tempname (s ? : tmpbuf, __GT_NOCREATE))
+  if (__builtin_expect (__gen_tempname (tmpbuf, __GT_NOCREATE), 0))
     return NULL;
 
   if (s == NULL)