OSDN Git Service
(root)
/
pf3gnuchains
/
gcc-fork.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Daily bump.
[pf3gnuchains/gcc-fork.git]
/
libiberty
/
make-temp-file.c
diff --git
a/libiberty/make-temp-file.c
b/libiberty/make-temp-file.c
index
5a6d488
..
5e21414
100644
(file)
--- a/
libiberty/make-temp-file.c
+++ b/
libiberty/make-temp-file.c
@@
-61,10
+61,10
@@
extern int mkstemps (char *, int);
If success, DIR is returned.
Otherwise NULL is returned. */
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 *
static inline const char *
-try (const char *dir, const char *base)
+try
_dir
(const char *dir, const char *base)
{
if (base != 0)
return base;
{
if (base != 0)
return base;
@@
-103,18
+103,18
@@
choose_tmpdir (void)
if (memoized_tmpdir)
return memoized_tmpdir;
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
#ifdef P_tmpdir
- base = try (P_tmpdir, base);
+ base = try
_dir
(P_tmpdir, base);
#endif
/* Try /var/tmp, /usr/tmp, then /tmp. */
#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)
/* 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);
/* 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';
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);
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);
+ TEMP_FILE_LEN
+ suffix_len + 1);
strcpy (temp_filename, base);