X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=libiberty%2Fchoose-temp.c;h=0a454cfa7ca1c8eb0cfcc3da4eb2a15bb2977303;hb=173373c6f6388171d1d62a217fae90a052395be2;hp=0cba9905d5bb9e41778d5fca5af45ecd532bfc64;hpb=01f0fe5e0450edf168c1f612feb93cf588e4e7ea;p=deliverable%2Fbinutils-gdb.git diff --git a/libiberty/choose-temp.c b/libiberty/choose-temp.c index 0cba9905d5..0a454cfa7c 100644 --- a/libiberty/choose-temp.c +++ b/libiberty/choose-temp.c @@ -22,6 +22,10 @@ Boston, MA 02110-1301, USA. */ #endif #include /* May get P_tmpdir. */ +#include +#ifdef HAVE_UNISTD_H +#include +#endif #ifdef HAVE_STDLIB_H #include #endif @@ -46,7 +50,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}. -This function is provided for backwards compatability only. Its use is +This function is provided for backwards compatibility only. Its use is not recommended. @end deftypefn @@ -65,8 +69,7 @@ choose_temp_base (void) 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; }