diff options
author | Denys Vlasenko <dvlasenk@redhat.com> | 2008-07-31 18:56:35 +0000 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2008-07-31 20:56:35 +0200 |
commit | a23eb008dc764028d758ef589f67aa822a2a81e1 (patch) | |
tree | 045aa0e1e55c97d4b396045787792803939cc6a8 /libiberty/mkstemps.c | |
parent | 93cc82d1f3d649ad736c07396f711c9f09e67dbd (diff) | |
download | gcc-a23eb008dc764028d758ef589f67aa822a2a81e1.zip gcc-a23eb008dc764028d758ef589f67aa822a2a81e1.tar.gz gcc-a23eb008dc764028d758ef589f67aa822a2a81e1.tar.bz2 |
mkstemps.c (mkstemps): If open failed with errno other than EEXIST, return immediately.
* mkstemps.c (mkstemps): If open failed with errno other than
EEXIST, return immediately.
* make-temp-file.c: Include errno.h.
(make_temp_file): If mkstemps failed, print an error message
before aborting.
From-SVN: r138429
Diffstat (limited to 'libiberty/mkstemps.c')
-rw-r--r-- | libiberty/mkstemps.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libiberty/mkstemps.c b/libiberty/mkstemps.c index 6c2e472..093b67a 100644 --- a/libiberty/mkstemps.c +++ b/libiberty/mkstemps.c @@ -127,6 +127,9 @@ mkstemps (char *pattern, int suffix_len) if (fd >= 0) /* The file does not exist. */ return fd; + if (errno != EEXIST) + /* Fatal error (EPERM, ENOSPC etc). Doesn't make sense to loop. */ + break; /* This is a random value. It is only necessary that the next TMP_MAX values generated by adding 7777 to VALUE are different |