X-Git-Url: https://oss.titaniummirror.com/gitweb?p=msp430-binutils.git;a=blobdiff_plain;f=libiberty%2Fmkstemps.c;fp=libiberty%2Fmkstemps.c;h=a0e68a73b4915d27d97b3b9d5d3779f6c3f7023f;hp=6c2e472528babdfd1da3d18afff2e7ba1beb0a2e;hb=88750007d7869f178f0ba528f41efd3b74c424cf;hpb=6df9443a374e2b81278c61b8afc0a1eef7db280b diff --git a/libiberty/mkstemps.c b/libiberty/mkstemps.c index 6c2e472..a0e68a7 100644 --- a/libiberty/mkstemps.c +++ b/libiberty/mkstemps.c @@ -127,6 +127,13 @@ mkstemps (char *pattern, int suffix_len) if (fd >= 0) /* The file does not exist. */ return fd; + if (errno != EEXIST +#ifdef EISDIR + && errno != EISDIR +#endif + ) + /* 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