diff options
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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; |