]> oss.titaniummirror.com Git - msp430-binutils.git/blobdiff - libiberty/mkstemps.c
Merge commit 'upstream/2.20'
[msp430-binutils.git] / libiberty / mkstemps.c
index 6c2e472528babdfd1da3d18afff2e7ba1beb0a2e..a0e68a73b4915d27d97b3b9d5d3779f6c3f7023f 100644 (file)
@@ -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