projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add "info connections" command, "info inferiors" connection number/string
[deliverable/binutils-gdb.git]
/
libiberty
/
choose-temp.c
diff --git
a/libiberty/choose-temp.c
b/libiberty/choose-temp.c
index 25c36cc997b2c46051c69b5fe104f88595592bee..72c1b710bd8bf7dbfe321a5ed3dbf89fa3e36183 100644
(file)
--- a/
libiberty/choose-temp.c
+++ b/
libiberty/choose-temp.c
@@
-1,5
+1,5
@@
/* Utility to pick a temporary filename prefix.
/* Utility to pick a temporary filename prefix.
- Copyright (C) 1996
, 1997, 1998
Free Software Foundation, Inc.
+ Copyright (C) 1996
-2019
Free Software Foundation, Inc.
This file is part of the libiberty library.
Libiberty is free software; you can redistribute it and/or
This file is part of the libiberty library.
Libiberty is free software; you can redistribute it and/or
@@
-14,14
+14,18
@@
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,
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., 5
9 Temple Place - Suite 330
,
-Boston, MA 0211
1-1307
, USA. */
+write to the Free Software Foundation, Inc., 5
1 Franklin Street - Fifth Floor
,
+Boston, MA 0211
0-1301
, USA. */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h> /* May get P_tmpdir. */
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h> /* May get P_tmpdir. */
+#include <sys/types.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
@@
-30,7
+34,6
@@
Boston, MA 02111-1307, USA. */
#endif
#include "libiberty.h"
#endif
#include "libiberty.h"
-extern char *choose_tmpdir (void);
/* Name of temporary file.
mktemp requires 6 trailing X's. */
/* Name of temporary file.
mktemp requires 6 trailing X's. */
@@
-46,7
+49,7
@@
find one. The current directory is chosen if all else fails so the
program is exited if a temporary directory can't be found (@code{mktemp}
fails). The buffer for the result is obtained with @code{xmalloc}.
program is exited if a temporary directory can't be found (@code{mktemp}
fails). The buffer for the result is obtained with @code{xmalloc}.
-This function is provided for backwards compat
a
bility only. Its use is
+This function is provided for backwards compat
i
bility only. Its use is
not recommended.
@end deftypefn
not recommended.
@end deftypefn
@@
-61,12
+64,11
@@
choose_temp_base (void)
int len;
len = strlen (base);
int len;
len = strlen (base);
- temp_filename =
xmalloc (
len + TEMP_FILE_LEN + 1);
+ temp_filename =
XNEWVEC (char,
len + TEMP_FILE_LEN + 1);
strcpy (temp_filename, base);
strcpy (temp_filename + len, TEMP_FILE);
strcpy (temp_filename, base);
strcpy (temp_filename + len, TEMP_FILE);
- mktemp (temp_filename);
- if (strlen (temp_filename) == 0)
+ if (mktemp (temp_filename) == 0)
abort ();
return temp_filename;
}
abort ();
return temp_filename;
}
This page took
0.025522 seconds
and
4
git commands to generate.