Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37713888
en ru br
ALT Linux repos
S:1.0.8-alt1
5.0: 1.0.1-alt2
4.1: 1.0.1-alt2
4.0: 1.0.1-alt2

Group :: Development/C
RPM: imake

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: xorg-x11-6.8.99.900-alt-imake-tmpdir.patch
Download


--- xc/config/imake/imake.c.orig	2005-03-02 17:30:31 +0300
+++ xc/config/imake/imake.c	2005-08-04 16:16:46 +0400
@@ -145,6 +145,11 @@
  *	#include INCLUDE_IMAKEFILE
  *	<add any global targets like 'clean' and long dependencies>
  */
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE 1
+#endif
+
 #if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__DragonFly__)
 /* This needs to be before _POSIX_SOURCE gets defined */
 # include <sys/param.h>
@@ -329,8 +334,8 @@
 
 char *cpp = NULL;
 
-char	*tmpMakefile = "/tmp/Imf.XXXXXX";
-char	*tmpImakefile = "/tmp/IIf.XXXXXX";
+char   *tmpMakefile;
+char   *tmpImakefile;
 char	*make_argv[ ARGUMENTS ] = {
 #ifdef WIN32
     "nmake"
@@ -396,6 +401,13 @@
 boolean verbose = FALSE;
 boolean show = TRUE;
 
+static char *get_tmp_file_name (void)
+{
+	char *name = 0;
+	asprintf (&name, "%s/imake.XXXXXX", getenv("TMPDIR") ?: "/tmp");
+	return name;
+}
+
 int
 main(int argc, char *argv[])
 {
@@ -427,7 +439,7 @@
 #ifdef HAS_MKSTEMP
 		int fd;
 #endif
-		tmpMakefile = Strdup(tmpMakefile);
+		tmpMakefile = get_tmp_file_name();
 #ifndef HAS_MKSTEMP
 		if (mktemp(tmpMakefile) == NULL ||
 		    (tmpfd = fopen(tmpMakefile, "w+")) == NULL) {
@@ -974,7 +986,7 @@
 static void
 get_libc_version(FILE *inFile)
 {
-  char aout[] = "/tmp/imakeXXXXXX";
+  char *aout = get_tmp_file_name();
   FILE *fp;
   const char *format = "%s -o %s -x c -";
   char *cc;
@@ -1790,7 +1802,7 @@
 #ifdef HAS_MKSTEMP
 			int fd;
 #endif
-			tmpImakefile = Strdup(tmpImakefile);
+			tmpImakefile = get_tmp_file_name();
 #ifndef HAS_MKSTEMP
 			if (mktemp(tmpImakefile) == NULL ||
 			    (outFile = fopen(tmpImakefile, "w+")) == NULL) {
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin