$OpenBSD: patch-proc_c,v 1.1 2006/04/09 10:10:25 alek Exp $ --- proc.c.orig Fri Mar 8 22:46:40 1996 +++ proc.c Sun Apr 9 12:05:56 2006 @@ -827,8 +827,14 @@ UnixToBuf(flags, bnm, InFName, cmd) int ph; swritef(pnbuf, sizeof(pnbuf), "%s/%s", TmpDir, "jpXXXXXX"); +#if 1 + 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 @@ bool wrap; jmp_buf sav_jmp; swritef(tnambuf, sizeof(tnambuf), "%s/%s", TmpDir, "jfXXXXXX"); +#if 1 + { + 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) {