From 9fc633cff3a2dba1b40dc7c3f5334bd5d69e2d95 Mon Sep 17 00:00:00 2001 From: marc Date: Sat, 25 Jul 1998 04:19:28 +0000 Subject: [PATCH] add the mktemp -> mkstemp patches --- editors/jove/patches/patch-ab | 19 ++++++++++++++++++ editors/jove/patches/patch-ac | 19 ++++++++++++++++++ editors/jove/patches/patch-ad | 15 ++++++++++++++ editors/jove/patches/patch-ae | 37 +++++++++++++++++++++++++++++++++++ 4 files changed, 90 insertions(+) create mode 100644 editors/jove/patches/patch-ab create mode 100644 editors/jove/patches/patch-ac create mode 100644 editors/jove/patches/patch-ad create mode 100644 editors/jove/patches/patch-ae diff --git a/editors/jove/patches/patch-ab b/editors/jove/patches/patch-ab new file mode 100644 index 00000000000..5222c4fb3d4 --- /dev/null +++ b/editors/jove/patches/patch-ab @@ -0,0 +1,19 @@ +--- io.c.~1~ Thu Mar 7 09:34:42 1996 ++++ io.c Fri Jul 24 19:17:53 1998 +@@ -1193,10 +1193,16 @@ + #endif + ); + tfname = copystr(buf); ++#if 0 + tfname = mktemp(tfname); ++#endif + #ifndef MSFILESYSTEM ++#if 1 ++ tmpfd = mkstemp(tfname); ++#else + (void) close(creat(tfname, 0600)); + tmpfd = open(tfname, 2); ++#endif + #else /* MSFILESYSTEM */ + tmpfd = open(tfname, O_CREAT|O_EXCL|O_BINARY|O_RDWR, S_IWRITE|S_IREAD); + #endif /* MSFILESYSTEM */ diff --git a/editors/jove/patches/patch-ac b/editors/jove/patches/patch-ac new file mode 100644 index 00000000000..a9b66fc6a55 --- /dev/null +++ b/editors/jove/patches/patch-ac @@ -0,0 +1,19 @@ +--- abbrev.c.~1~ Thu Mar 7 09:34:41 1996 ++++ abbrev.c Fri Jul 24 19:22:45 1998 +@@ -274,7 +274,16 @@ + "jabbXXXXXX" + #endif + ); ++#if 1 ++ { ++ int fd = mkstemp(tname); ++ if ( fd == -1 ) ++ err( 1, "can't create temp file %s", tname ); ++ close( fd ); ++ } ++#else + (void) mktemp(tname); ++#endif + save_abbrevs(tname); + setfname(ebuf, tname); + read_file(tname, NO); diff --git a/editors/jove/patches/patch-ad b/editors/jove/patches/patch-ad new file mode 100644 index 00000000000..ce72232e5e1 --- /dev/null +++ b/editors/jove/patches/patch-ad @@ -0,0 +1,15 @@ +--- rec.c.~1~ Thu Mar 7 09:34:43 1996 ++++ rec.c Fri Jul 24 19:25:22 1998 +@@ -55,8 +55,12 @@ + #endif + ); + recfname = copystr(buf); ++#if 1 ++ rec_fd = mkstemp(recfname); ++#else + recfname = mktemp(recfname); + rec_fd = creat(recfname, 0644); ++#endif + if (rec_fd == -1) { + complain("Cannot create \"%s\"; recovery disabled.", recfname); + /*NOTREACHED*/ diff --git a/editors/jove/patches/patch-ae b/editors/jove/patches/patch-ae new file mode 100644 index 00000000000..a34782ad1d7 --- /dev/null +++ b/editors/jove/patches/patch-ae @@ -0,0 +1,37 @@ +--- proc.c.orig Fri Mar 8 13:46:40 1996 ++++ proc.c Fri Jul 24 19:42:45 1998 +@@ -827,8 +827,14 @@ + 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 @@ + 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) {