From 28ca5cb128ce3e4e9d59740df443065a396b664a Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Wed, 22 Jan 2020 10:44:19 +0300 Subject: [PATCH] Ticket #4052: fix FTBFS on OSes w/o O_CLOEXEC. Signed-off-by: Andrew Borodin --- lib/tty/tty-internal.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/tty/tty-internal.c b/lib/tty/tty-internal.c index c3bc5a9b3..600576de8 100644 --- a/lib/tty/tty-internal.c +++ b/lib/tty/tty-internal.c @@ -45,6 +45,16 @@ int sigwinch_pipe[2]; /*** file scope macro definitions ****************************************************************/ +/* some OSes don't provide O_CLOEXEC */ +#if !defined O_CLOEXEC && defined O_NOINHERIT +/* Mingw spells it 'O_NOINHERIT'. */ +#define O_CLOEXEC O_NOINHERIT +#endif + +#ifndef O_CLOEXEC +#define O_CLOEXEC 0 +#endif + /*** global variables ****************************************************************************/ /*** file scope type declarations ****************************************************************/