diff options
author | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2013-07-07 13:18:41 -0400 |
---|---|---|
committer | Andrew J. Schorr <aschorr@telemetry-investments.com> | 2013-07-07 13:18:41 -0400 |
commit | 69b59a73db108ede65e4dfce90fcfb10723e1feb (patch) | |
tree | 90e22744ae5e64df563a3114422928ab88985995 /extension/select.c | |
parent | faf3affc19f760a330153b22a8e56fc9a13a0cb6 (diff) | |
download | egawk-69b59a73db108ede65e4dfce90fcfb10723e1feb.tar.gz egawk-69b59a73db108ede65e4dfce90fcfb10723e1feb.tar.bz2 egawk-69b59a73db108ede65e4dfce90fcfb10723e1feb.zip |
Patch the select extension's set_non_blocking function to check that fcntl and O_NONBLOCK are available.
Diffstat (limited to 'extension/select.c')
-rw-r--r-- | extension/select.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/extension/select.c b/extension/select.c index 072a562f..9aefaeac 100644 --- a/extension/select.c +++ b/extension/select.c @@ -481,6 +481,7 @@ do_select(int nargs, awk_value_t *result) static int set_non_blocking(int fd) { +#if defined(HAVE_FCNTL) && defined(O_NONBLOCK) int flags; if (((flags = fcntl(fd, F_GETFL)) == -1) || @@ -489,6 +490,10 @@ set_non_blocking(int fd) return -1; } return 0; +#else + update_ERRNO_string(_("set_non_blocking: not supported on this platform")); + return -1; +#endif } /* do_set_non_blocking --- Set a file to be non-blocking */ |