* dwarf2loc.c (dwarf_expr_frame_base): Error out on missing
[deliverable/binutils-gdb.git] / libiberty / make-temp-file.c
index 71fb7037f4628595d0cde8dc35300b9f36da4598..5e21414ad8eed1f8294879235c2775f13956a647 100644 (file)
@@ -14,8 +14,8 @@ Library General Public License for more details.
 
 You should have received a copy of the GNU Library General Public
 License along with libiberty; see the file COPYING.LIB.  If not,
-write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+write to the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
+Boston, MA 02110-1301, USA.  */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -61,10 +61,10 @@ extern int mkstemps (char *, int);
    If success, DIR is returned.
    Otherwise NULL is returned.  */
 
-static inline const char *try (const char *, const char *);
+static inline const char *try_dir (const char *, const char *);
 
 static inline const char *
-try (const char *dir, const char *base)
+try_dir (const char *dir, const char *base)
 {
   if (base != 0)
     return base;
@@ -103,18 +103,18 @@ choose_tmpdir (void)
   if (memoized_tmpdir)
     return memoized_tmpdir;
 
-  base = try (getenv ("TMPDIR"), base);
-  base = try (getenv ("TMP"), base);
-  base = try (getenv ("TEMP"), base);
+  base = try_dir (getenv ("TMPDIR"), base);
+  base = try_dir (getenv ("TMP"), base);
+  base = try_dir (getenv ("TEMP"), base);
 
 #ifdef P_tmpdir
-  base = try (P_tmpdir, base);
+  base = try_dir (P_tmpdir, base);
 #endif
 
   /* Try /var/tmp, /usr/tmp, then /tmp.  */
-  base = try (vartmp, base);
-  base = try (usrtmp, base);
-  base = try (tmp, base);
+  base = try_dir (vartmp, base);
+  base = try_dir (usrtmp, base);
+  base = try_dir (tmp, base);
  
   /* If all else fails, use the current directory!  */
   if (base == 0)
@@ -123,7 +123,7 @@ choose_tmpdir (void)
   /* Append DIR_SEPARATOR to the directory we've chosen
      and return it.  */
   len = strlen (base);
-  tmpdir = xmalloc (len + 2);
+  tmpdir = XNEWVEC (char, len + 2);
   strcpy (tmpdir, base);
   tmpdir[len] = DIR_SEPARATOR;
   tmpdir[len+1] = '\0';
@@ -158,7 +158,7 @@ make_temp_file (const char *suffix)
   base_len = strlen (base);
   suffix_len = strlen (suffix);
 
-  temp_filename = xmalloc (base_len
+  temp_filename = XNEWVEC (char, base_len
                           + TEMP_FILE_LEN
                           + suffix_len + 1);
   strcpy (temp_filename, base);
This page took 0.027912 seconds and 4 git commands to generate.