From bf0c16acdae72543e2f2fb51a27a6845c9f97963 Mon Sep 17 00:00:00 2001 From: Daniel Ahlberg Date: Fri, 21 Nov 2003 15:52:21 +0000 Subject: Closing #22356 --- net-misc/vnc/files/vnc-3.3.7-imake-tmpdir.patch | 37 +++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 net-misc/vnc/files/vnc-3.3.7-imake-tmpdir.patch (limited to 'net-misc/vnc/files') diff --git a/net-misc/vnc/files/vnc-3.3.7-imake-tmpdir.patch b/net-misc/vnc/files/vnc-3.3.7-imake-tmpdir.patch new file mode 100644 index 000000000000..9d5ccc58ad76 --- /dev/null +++ b/net-misc/vnc/files/vnc-3.3.7-imake-tmpdir.patch @@ -0,0 +1,37 @@ +--- vnc_unixsrc/Xvnc/config/imake/imake.c.orig 2000-06-11 14:00:51.000000000 +0200 ++++ vnc_unixsrc/Xvnc/config/imake/imake.c 2003-09-01 22:59:25.000000000 +0200 +@@ -913,12 +913,25 @@ + static void get_libc_version(inFile) + FILE* inFile; + { +- char *aout = tmpnam (NULL); ++ char aout[PATH_MAX]; + FILE *fp; + const char *format = "%s -o %s -x c -"; + char *cc; + int len; + char *command; ++ char *tmpdir; ++ int tmpfd; ++ ++ if((tmpdir = getenv("TMPDIR")) != NULL && strlen(tmpdir) < (PATH_MAX-13)) ++ strcpy(aout, tmpdir); ++ else ++ strcpy(aout, "/tmp"); ++ strcat(aout, "/imakeXXXXXX"); ++ ++ if((tmpfd = mkstemp(aout)) == -1) { ++ perror("mkstemp"); ++ abort(); ++ } + + cc = getenv ("CC"); + if (cc == NULL) +@@ -930,6 +943,7 @@ + if (snprintf (command , len, format, cc, aout) == len) + abort (); + ++ close(tmpfd); + fp = popen (command, "w"); + if (fp == NULL || fprintf (fp, "%s\n", libc_c) < 0 + || pclose (fp) != 0) -- cgit v1.2.3-65-gdbad