This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Libiberty for VMS - Non polluting names for make-temp-file.c



Logical names (environment variables) are used extensively on VMS, which doesn't have the TMP* tradition of Unix, so non-polluting names are needed.


Tested on x86-64-linux-gnu

--Douglas B Rupp
AdaCore



2009-07-22  Douglas B Rupp  <rupp@gnat.com>

	* make-temp-file.c (GNUTMPDIR, GNUTMP, GNUTEMP): New non polluting
	macros.

diff -rupN libiberty/make-temp-file.c libiberty/make-temp-file.c
--- libiberty/make-temp-file.c	2008-07-31 11:56:35.000000000 -0700
+++ libiberty/make-temp-file.c	2009-01-21 14:40:34.000000000 -0800
@@ -111,9 +111,16 @@ choose_tmpdir (void)
       char *tmpdir;
       unsigned int len;
       
+#ifdef VMS
+      /* Use non-polluting names.  */
+      base = try_dir (getenv ("GNUTMPDIR"), base);
+      base = try_dir (getenv ("GNUTMP"), base);
+      base = try_dir (getenv ("GNUTEMP"), base);
+#else
       base = try_dir (getenv ("TMPDIR"), base);
       base = try_dir (getenv ("TMP"), base);
       base = try_dir (getenv ("TEMP"), base);
+#endif
       
 #ifdef P_tmpdir
       base = try_dir (P_tmpdir, base);

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]