mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-03 02:31:03 -08:00
Update from Gnulib
This incorporates: 2019-06-04 copy-file-range: new module 2019-05-28 binaty-io: O_BINARY on consoles no longer fails * doc/misc/texinfo.tex, lib/binary-io.c, lib/binary-io.h: * lib/unistd.in.h, m4/unistd_h.m4: Copy from Gnulib. * lib/gnulib.mk.in: Regenerate.
This commit is contained in:
parent
a14eb43215
commit
111408a0e9
6 changed files with 42 additions and 21 deletions
|
|
@ -20,18 +20,20 @@
|
|||
#include "binary-io.h"
|
||||
|
||||
#if defined __DJGPP__ || defined __EMX__
|
||||
# include <errno.h>
|
||||
# include <unistd.h>
|
||||
|
||||
int
|
||||
__gl_setmode_check (int fd)
|
||||
set_binary_mode (int fd, int mode)
|
||||
{
|
||||
if (isatty (fd))
|
||||
{
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
/* If FD refers to a console (not a pipe, not a regular file),
|
||||
O_TEXT is the only reasonable mode, both on input and on output.
|
||||
Silently ignore the request. If we were to return -1 here,
|
||||
all programs that use xset_binary_mode would fail when run
|
||||
with console input or console output. */
|
||||
return O_TEXT;
|
||||
else
|
||||
return 0;
|
||||
return __gl_setmode (fd, mode);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue