mirror of
https://git.savannah.gnu.org/git/make.git
synced 2024-10-23 12:50:00 +00:00
* src/posixos.c (os_anontmp): [SV 63287] Only fail O_TMPFILE once
Reported by Dmitry Goncharov <dgoncharov@users.sf.net>.
This commit is contained in:
parent
b92340a1ea
commit
11f9da227e
1 changed files with 11 additions and 5 deletions
|
@ -843,12 +843,18 @@ os_anontmp ()
|
||||||
int fd = -1;
|
int fd = -1;
|
||||||
|
|
||||||
#ifdef O_TMPFILE
|
#ifdef O_TMPFILE
|
||||||
|
static unsigned int tmpfile_works = 1;
|
||||||
|
|
||||||
|
if (tmpfile_works)
|
||||||
|
{
|
||||||
EINTRLOOP (fd, open (tdir, O_RDWR | O_TMPFILE | O_EXCL, 0600));
|
EINTRLOOP (fd, open (tdir, O_RDWR | O_TMPFILE | O_EXCL, 0600));
|
||||||
if (fd >= 0)
|
if (fd >= 0)
|
||||||
return fd;
|
return fd;
|
||||||
|
|
||||||
DB (DB_BASIC, (_("Cannot open '%s' with O_TMPFILE: %s.\n"),
|
DB (DB_BASIC, (_("Cannot open '%s' with O_TMPFILE: %s.\n"),
|
||||||
tdir, strerror (errno)));
|
tdir, strerror (errno)));
|
||||||
|
tmpfile_works = 0;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_DUP
|
#if HAVE_DUP
|
||||||
|
|
Loading…
Reference in a new issue