1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Update from Gnulib

This incorporates:
2020-03-07 open, openat: port to (O_RDWR | O_RDONLY) != 0
* lib/open.c: Copy from Gnulib.
This commit is contained in:
Paul Eggert 2020-03-07 11:58:20 -08:00
parent 3274b8090b
commit 9f4b260c2b

View file

@ -110,7 +110,9 @@ open (const char *filename, int flags, ...)
directories, directories,
- if O_WRONLY or O_RDWR is specified, open() must fail because the - if O_WRONLY or O_RDWR is specified, open() must fail because the
file does not contain a '.' directory. */ 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); size_t len = strlen (filename);
if (len > 0 && filename[len - 1] == '/') if (len > 0 && filename[len - 1] == '/')