aboutsummaryrefslogtreecommitdiff
path: root/stdlib
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2001-04-04 00:01:02 +0000
committerUlrich Drepper <drepper@redhat.com>2001-04-04 00:01:02 +0000
commitc891b2df087e0219319785c29d3af6042e4ac94f (patch)
tree35f252e14d0024b991068214f533f738d23bdab7 /stdlib
parentf114375059d2f3ee90aaeea242120b3dda84787b (diff)
downloadglibc-c891b2df087e0219319785c29d3af6042e4ac94f.tar
glibc-c891b2df087e0219319785c29d3af6042e4ac94f.tar.gz
glibc-c891b2df087e0219319785c29d3af6042e4ac94f.tar.bz2
glibc-c891b2df087e0219319785c29d3af6042e4ac94f.zip
Update.
2001-04-03 Ulrich Drepper <drepper@redhat.com> * misc/dirname.c (dirname): Handle multiple slashes correctly. 2001-04-03 Martin Schwidefsky <schwidefsky@de.ibm.com> * sysdeps/s390/s390-64/initfini.c: Fix __gmon_start__ GOT access. 2001-04-03 Martin Schwidefsky <schwidefsky@de.ibm.com> * sysdeps/s390/s390-32/bcopy.S: Optimize for speed. * sysdeps/s390/s390-64/bcopy.S: Likewise. * sysdeps/s390/s390-32/mempcy.S: Likewise. * sysdeps/s390/s390-64/memcpy.S: Likewise. 2001-04-02 Bruno Haible <haible@clisp.cons.org> * manual/message.texi (Advanced gettext functions): More specific syntax in the plural formula examples. 2001-04-02 Franz Sirl <Franz.Sirl-kernel@lauterbach.com> * sysdeps/powerpc/atomicity.h: Silence warnings. * sysdeps/powerpc/dl-machine.h: Likewise. * sysdeps/powerpc/register-dump.h: Likewise. * sysdeps/powerpc/fpu/s_lrint.c: Likewise. 2001-04-02 Andreas Jaeger <aj@suse.de> * misc/tst-dirname.c (main): Add more tests, derived from a bug report by Michael Kerrisk <mtk16@ext.canterbury.ac.nz>. 2001-04-01 Andreas Jaeger <aj@suse.de> * debug/xtrace.sh (pcprofileso): Use SLIBDIR since libpcprofile.so is installed there. * malloc/memusage.sh (memusageso): Likewise for libmemusage.so. 2001-04-01 H.J. Lu <hjl@gnu.org> * posix/annexc.c (macrofile): Renamed from TMPFILE and set to tmpnam (NULL). * stdlib/isomac.c (macrofile): Likewise. 2001-03-30 Thorsten Kukuk <kukuk@suse.de> * inet/rcmd.c: Allow AF_UNSPEC as parameter. * nis/ypclnt.c (yp_all): Print error message only at last try, check for protocoll error only if we don't have a network error.
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/isomac.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/stdlib/isomac.c b/stdlib/isomac.c
index ab63d1b154..f18e8d92eb 100644
--- a/stdlib/isomac.c
+++ b/stdlib/isomac.c
@@ -52,7 +52,7 @@
preprocessor has something similar to gcc's -dM option. Tune
PRINT_MACROS in this case. This program assumes headers are found
under /usr/include and that there is a writable /tmp directory.
- Tune SYSTEM_INCLUDE and TMPFILE if your system differs.
+ Tune SYSTEM_INCLUDE if your system differs.
#define BROKEN_SYSTEM if system(NULL) bombs -- one more violation
of ISO C, by the way.
@@ -75,9 +75,10 @@
#include <stdlib.h>
#include <string.h>
-#define TMPFILE "/tmp/macros"
#define HEADER_MAX 256
+static const char *macrofile;
+
/* ISO C header names including Amendment 1 (without ".h" suffix). */
static char *header[] =
{
@@ -247,8 +248,10 @@ get_null_defines (void)
FILE *input;
int first = 1;
+ macrofile = tmpnam (NULL);
+
command = malloc (sizeof fmt + sizeof "/dev/null" + 2 * strlen (CC)
- + strlen (INC) + strlen (TMPFILE));
+ + strlen (INC) + strlen (macrofile));
if (command == NULL)
{
@@ -256,7 +259,7 @@ get_null_defines (void)
exit (1);
}
- sprintf (command, fmt, "/dev/null", CC, INC, CC, TMPFILE);
+ sprintf (command, fmt, "/dev/null", CC, INC, CC, macrofile);
if (system (command))
{
@@ -264,11 +267,11 @@ get_null_defines (void)
return NULL;
}
free (command);
- input = fopen (TMPFILE, "r");
+ input = fopen (macrofile, "r");
if (input == NULL)
{
- printf ("Could not read %s: ", TMPFILE);
+ printf ("Could not read %s: ", macrofile);
perror (NULL);
return NULL;
}
@@ -321,7 +324,7 @@ get_null_defines (void)
}
result[result_len] = NULL;
fclose (input);
- remove (TMPFILE);
+ remove (macrofile);
return (const char **) result;
}
@@ -335,7 +338,7 @@ check_header (const char *file_name, const char **except)
int result = 0;
command = malloc (sizeof fmt + strlen (file_name) + 2 * strlen (CC)
- + strlen (INC) + strlen (TMPFILE));
+ + strlen (INC) + strlen (macrofile));
if (command == NULL)
{
@@ -344,7 +347,7 @@ check_header (const char *file_name, const char **except)
}
puts (file_name);
- sprintf (command, fmt, file_name, CC, INC, CC, TMPFILE);
+ sprintf (command, fmt, file_name, CC, INC, CC, macrofile);
if (system (command))
{
@@ -352,11 +355,11 @@ check_header (const char *file_name, const char **except)
result = 1;
}
free (command);
- input = fopen (TMPFILE, "r");
+ input = fopen (macrofile, "r");
if (input == NULL)
{
- printf ("Could not read %s: ", TMPFILE);
+ printf ("Could not read %s: ", macrofile);
perror (NULL);
return 1;
}
@@ -430,7 +433,7 @@ check_header (const char *file_name, const char **except)
}
}
fclose (input);
- remove (TMPFILE);
+ remove (macrofile);
return result;
}