freebsd-ports/editors/jove/files/patch-io.c
Tobias Kortkamp 49aeb93155 JOVE defines a getline function that collides with getline(3).
r419275 tried to fix it by renaming it to get_line, but a few renames
were missed leading to crashes when trying to run JOVE.  Finish the
previous work and also add LICENSE while here.

PR:		217516
Submitted by:	crahman@gmail.com (based on)
Reviewed by:	crahman@gmail.com
Approved by:	mat (mentor)
Differential Revision:	https://reviews.freebsd.org/D9881
2017-03-04 00:03:01 +00:00

19 lines
449 B
C

--- io.c.orig 1996-03-07 17:34:42 UTC
+++ io.c
@@ -1193,10 +1193,16 @@ tmpinit()
#endif
);
tfname = copystr(buf);
+#ifdef NO_MKSTEMP
tfname = mktemp(tfname);
+#endif
#ifndef MSFILESYSTEM
+#ifndef NO_MKSTEMP
+ 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 */