openbsd-ports/devel/gmake/patches/patch-ac

35 lines
835 B
Plaintext

*** main.c.orig Thu Nov 19 10:35:08 1998
--- main.c Thu Nov 19 10:44:03 1998
***************
*** 1082,1089 ****
--- 1082,1096 ----
#else
static char name[] = "/tmp/GmXXXXXX";
#endif
+ #ifndef __OpenBSD__
(void) mktemp (name);
#else
+ int ftmp;
+
+ if ((ftmp = mkstemp (name)) < 0)
+ pfatal_with_name ("mkstemp (temporary file)");
+ #endif
+ #else
static char name[L_tmpnam];
(void) tmpnam (name);
#endif
***************
*** 1091,1097 ****
--- 1098,1108 ----
if (stdin_nm)
fatal("Makefile from standard input specified twice.");
+ #ifndef __OpenBSD__
outfile = fopen (name, "w");
+ #else
+ outfile = fdopen (ftmp, "w");
+ #endif
if (outfile == 0)
pfatal_with_name ("fopen (temporary file)");
while (!feof (stdin))