summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
Diffstat (limited to 'io.c')
-rw-r--r--io.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/io.c b/io.c
index e0e48ac3bc..11bdc85910 100644
--- a/io.c
+++ b/io.c
@@ -397,9 +397,12 @@ wsplit_p(OpenFile *fptr)
struct stat buf;
if (fstat(fileno(f), &buf) == 0 &&
!(S_ISREG(buf.st_mode) ||
- S_ISDIR(buf.st_mode)) &&
- (r = fcntl(fileno(f), F_GETFL)) != -1 &&
- !(r & O_NONBLOCK)) {
+ S_ISDIR(buf.st_mode))
+#if defined(HAVE_FCNTL) && defined(F_GETFL) && defined(O_NONBLOCK)
+ && (r = fcntl(fileno(f), F_GETFL)) != -1 &&
+ !(r & O_NONBLOCK)
+#endif
+ ) {
fptr->mode |= FMODE_WSPLIT;
}
fptr->mode |= FMODE_WSPLIT_INITIALIZED;