Keep .plt section and DT_PLTGOT for prelink
[binutils-gdb.git] / libiberty / mkstemps.c
index 093b67af868baa27dc58a07e77a7abbb5f0ba434..0e06fe17059a03c9a0d343beecaa5d60b8dae00d 100644 (file)
@@ -35,6 +35,8 @@
 #endif
 #ifdef HAVE_SYS_TIME_H
 #include <sys/time.h>
+#elif HAVE_TIME_H
+#include <time.h>
 #endif
 #include "ansidecl.h"
 
@@ -127,7 +129,11 @@ mkstemps (char *pattern, int suffix_len)
       if (fd >= 0)
        /* The file does not exist.  */
        return fd;
-      if (errno != EEXIST)
+      if (errno != EEXIST
+#ifdef EISDIR
+         && errno != EISDIR
+#endif
+        )
        /* Fatal error (EPERM, ENOSPC etc).  Doesn't make sense to loop.  */
        break;