summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Ahlberg <aliz@gentoo.org>2003-09-17 14:04:03 +0000
committerDaniel Ahlberg <aliz@gentoo.org>2003-09-17 14:04:03 +0000
commit0843259d9aa43725f5b70c6b7b4ea859463fb43f (patch)
tree37dc818a2ca71a122f4192dbdba3762f278ee7bc /net-misc/tightvnc/files/tightvnc-1.2.9-imake-tmpdir.patch
parentclosing #23843 (diff)
downloadhistorical-0843259d9aa43725f5b70c6b7b4ea859463fb43f.tar.gz
historical-0843259d9aa43725f5b70c6b7b4ea859463fb43f.tar.bz2
historical-0843259d9aa43725f5b70c6b7b4ea859463fb43f.zip
closing #23843
Diffstat (limited to 'net-misc/tightvnc/files/tightvnc-1.2.9-imake-tmpdir.patch')
-rw-r--r--net-misc/tightvnc/files/tightvnc-1.2.9-imake-tmpdir.patch37
1 files changed, 37 insertions, 0 deletions
diff --git a/net-misc/tightvnc/files/tightvnc-1.2.9-imake-tmpdir.patch b/net-misc/tightvnc/files/tightvnc-1.2.9-imake-tmpdir.patch
new file mode 100644
index 000000000000..9d5ccc58ad76
--- /dev/null
+++ b/net-misc/tightvnc/files/tightvnc-1.2.9-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)