1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-29 01:13:08 +00:00
freebsd-ports/editors/jove/files/patch-af
Kevin Lo 641cfa39ea - Support CFLAGS properly
- Support install macros
- mktemp() -> mkstemp()
- Remove unnecessary manpages

PR: 23759
Submitted by: Ports Fury
2000-12-22 16:42:19 +00:00

38 lines
936 B
Plaintext

--- proc.c.orig Sat Mar 9 06:46:40 1996
+++ proc.c Wed Dec 20 05:20:13 2000
@@ -827,8 +827,14 @@
int ph;
swritef(pnbuf, sizeof(pnbuf), "%s/%s", TmpDir, "jpXXXXXX");
+#ifndef NO_MKSTEMP
+ pipename = pnbuf;
+ ph = mkstemp( pipename );
+#else
pipename = mktemp(pnbuf);
- if ((ph = creat(pipename, S_IWRITE|S_IREAD)) < 0)
+ ph = creat(pipename, S_IWRITE|S_IREAD);
+#endif
+ if (ph == -1)
complain("cannot make pipe for filter: %s", strerror(errno));
close(1);
close(2);
@@ -923,7 +929,18 @@
jmp_buf sav_jmp;
swritef(tnambuf, sizeof(tnambuf), "%s/%s", TmpDir, "jfXXXXXX");
+#ifndef NO_MKSTEMP
+ {
+ int fd = mkstemp(tnambuf);
+ if ( fd == -1 )
+ complain( "can't create temp file %s: %s",
+ tnambuf, strerror(errno) );
+ close( fd );
+ tname = tnambuf;
+ }
+#else
tname = mktemp(tnambuf);
+#endif
fp = open_file(tname, iobuff, F_WRITE, YES);
push_env(sav_jmp);
if (setjmp(mainjmp) == 0) {