mirror of
https://git.savannah.gnu.org/git/make.git
synced 2025-01-03 19:04:33 +00:00
(main) [! HAVE_MKTEMP]: Use tmpnam instead of mktemp.
This commit is contained in:
parent
fecd9e661a
commit
21a8ec0d72
1 changed files with 6 additions and 1 deletions
7
main.c
7
main.c
|
@ -700,11 +700,16 @@ main (argc, argv, envp)
|
||||||
/* This makefile is standard input. Since we may re-exec
|
/* This makefile is standard input. Since we may re-exec
|
||||||
and thus re-read the makefiles, we read standard input
|
and thus re-read the makefiles, we read standard input
|
||||||
into a temporary file and read from that. */
|
into a temporary file and read from that. */
|
||||||
static char name[] = "/tmp/GmXXXXXX";
|
|
||||||
FILE *outfile;
|
FILE *outfile;
|
||||||
|
|
||||||
/* Make a unique filename. */
|
/* Make a unique filename. */
|
||||||
|
#ifdef HAVE_MKTEMP
|
||||||
|
static char name[] = "/tmp/GmXXXXXX";
|
||||||
(void) mktemp (name);
|
(void) mktemp (name);
|
||||||
|
#else
|
||||||
|
static char name[L_tmpnam];
|
||||||
|
(void) tmpnam ();
|
||||||
|
#endif
|
||||||
|
|
||||||
outfile = fopen (name, "w");
|
outfile = fopen (name, "w");
|
||||||
if (outfile == 0)
|
if (outfile == 0)
|
||||||
|
|
Loading…
Reference in a new issue