1998-12-15  Andreas Jaeger  <aj@arthur.rhein-neckar.de> 
 
	* stdio-common/tst-tmpnam.c (main): Use void as parameter to avoid  
	warnings about unused args.  Fix comment. 
 
1998-12-15  Andreas Jaeger  <aj@arthur.rhein-neckar.de> 
 
	* sysdeps/posix/tempname.c (__path_search): Correct last patch.
This commit is contained in:
Ulrich Drepper 1998-12-15 00:02:24 +00:00
parent 181a8546c8
commit b61af6fc2e
3 changed files with 21 additions and 9 deletions

View File

@ -1,3 +1,12 @@
1998-12-15 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* stdio-common/tst-tmpnam.c (main): Use void as parameter to avoid
warnings about unused args. Fix comment.
1998-12-15 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* sysdeps/posix/tempname.c (__path_search): Correct last patch.
1998-12-14 Ulrich Drepper <drepper@cygnus.com>
* sunrpc/rpc/xdr.h (IXDR_GET_INT32): Case pointer before reading from

View File

@ -21,7 +21,7 @@
#include <string.h>
int
main (int argc, char *argv[])
main (void)
{
const char *name;
int retval = 0;
@ -33,7 +33,7 @@ main (int argc, char *argv[])
printf ("name = %s\n", name);
/* Make sure the name is based on the value in TMPDIR. */
/* Make sure the name is not based on the value in TMPDIR. */
if (strncmp (name, "/usr", 4) == 0)
{
puts ("error: `tmpnam' used TMPDIR value");

View File

@ -69,14 +69,17 @@ __path_search (char *tmpl, size_t tmpl_len, const char *dir, const char *pfx,
else if (dir != NULL && direxists (dir))
/* nothing */ ;
}
if (direxists (P_tmpdir))
dir = P_tmpdir;
else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp"))
dir = "/tmp";
else
if (dir != NULL)
{
__set_errno (ENOENT);
return -1;
if (direxists (P_tmpdir))
dir = P_tmpdir;
else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp"))
dir = "/tmp";
else
{
__set_errno (ENOENT);
return -1;
}
}
dlen = strlen (dir);