Date: Wed, 31 May 2000 22:17:18 -0500 (CDT) From: Glenn Johnson <gjohnson@nola.srrc.usda.gov> To: FreeBSD-gnats-submit@freebsd.org Subject: gnu/18930: Fix libg2c mktemp() problem Message-ID: <200006010317.WAA73146@symbion.srrc.usda.gov>
next in thread | raw e-mail | index | archive | help
>Number: 18930
>Category: gnu
>Synopsis: Fix mktemp() problem with libg2c
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Wed May 31 20:20:00 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator: Glenn Johnson
>Release: FreeBSD 4.0-STABLE i386
>Organization:
>Environment:
FreeBSD 4-STABLE.
>Description:
libg2c uses mktemp() and tempnam() which causes all Fortran
programs linked with it to issue a warning upon linking and of course
makes the resulting binaries susceptible to problems of mktemp().
>How-To-Repeat:
Compile and link any Fortran program with FreeBSD 4. I do not
know if this applies to CURRENT, but I suspect it does.
>Fix:
Apply the following patch in the /usr/src/contrib/libf2c/libI77
subdirectory.
--- rawio.h.orig Wed May 31 18:05:12 2000
+++ rawio.h Wed May 31 18:05:22 2000
@@ -28,7 +28,7 @@
#endif
#endif /*KR_HEADERS*/
-extern char *mktemp(char*);
+extern char *mkstemp(char*);
#ifdef __cplusplus
}
--- open.c.orig Wed May 31 18:05:30 2000
+++ open.c Wed May 31 18:05:59 2000
@@ -15,7 +15,7 @@
#ifdef KR_headers
extern char *malloc();
#ifdef NON_ANSI_STDIO
-extern char *mktemp();
+extern char *mkstemp();
#endif
extern integer f_clos();
#else
@@ -210,7 +210,7 @@
case 'S':
b->uscrtch=1;
#ifdef HAVE_TEMPNAM /* Allow use of TMPDIR preferentially. */
- s = tempnam (0, buf);
+ s = mkstemp (buf);
if (strlen (s) >= sizeof (buf))
err (a->oerr, 132, "open");
(void) strcpy (buf, s);
@@ -220,7 +220,7 @@
tmpnam(buf);
#else
(void) strcpy(buf,"tmp.FXXXXXX");
- (void) mktemp(buf);
+ (void) mkstemp(buf);
#endif
#endif /* ! defined (HAVE_TEMPNAM) */
goto replace;
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200006010317.WAA73146>
