From: Paul Eggert Date: Sat, 7 Mar 2020 19:58:20 +0000 (-0800) Subject: Update from Gnulib X-Git-Tag: emacs-28.0.90~7791 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9f4b260c2b98ea05a02e0ab7213156ce2e60e5a9;p=emacs.git Update from Gnulib This incorporates: 2020-03-07 open, openat: port to (O_RDWR | O_RDONLY) != 0 * lib/open.c: Copy from Gnulib. --- diff --git a/lib/open.c b/lib/open.c index 487194f6652..bb180fde292 100644 --- a/lib/open.c +++ b/lib/open.c @@ -110,7 +110,9 @@ open (const char *filename, int flags, ...) directories, - if O_WRONLY or O_RDWR is specified, open() must fail because the file does not contain a '.' directory. */ - if (flags & (O_CREAT | O_WRONLY | O_RDWR)) + if ((flags & O_CREAT) + || (flags & O_ACCMODE) == O_RDWR + || (flags & O_ACCMODE) == O_WRONLY) { size_t len = strlen (filename); if (len > 0 && filename[len - 1] == '/')