X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=libiberty%2Fmkstemps.c;h=b57880ef0ed7a07baf1c67ba67dbfbeaad28697b;hb=d488367a421f4c4fd47d37ae0013318024b1019b;hp=093b67af868baa27dc58a07e77a7abbb5f0ba434;hpb=f562800dc425ea951fcde303518467c5424e3b18;p=deliverable%2Fbinutils-gdb.git diff --git a/libiberty/mkstemps.c b/libiberty/mkstemps.c index 093b67af86..b57880ef0e 100644 --- a/libiberty/mkstemps.c +++ b/libiberty/mkstemps.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1996, 1998, 2004 Free Software Foundation, Inc. +/* Copyright (C) 1991-2019 Free Software Foundation, Inc. This file is derived from mkstemp.c from the GNU C Library. The GNU C Library is free software; you can redistribute it and/or @@ -35,6 +35,8 @@ #endif #ifdef HAVE_SYS_TIME_H #include +#elif HAVE_TIME_H +#include #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;