summaryrefslogtreecommitdiff
path: root/main/streams/plain_wrapper.c
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2005-07-18 13:28:24 +0000
committerWez Furlong <wez@php.net>2005-07-18 13:28:24 +0000
commitc4ba9edd57c958c351b025dbbd889963abd58ba7 (patch)
treea3a8cc9870af0f9e2f89fa860be94cdc8965eb3a /main/streams/plain_wrapper.c
parentf90bdf89330510cb58c2dc12e66f27aa21287ac2 (diff)
downloadphp-git-c4ba9edd57c958c351b025dbbd889963abd58ba7.tar.gz
Apparently our pipe detection code just above this isn't foolproof.
Catch it here.
Diffstat (limited to 'main/streams/plain_wrapper.c')
-rw-r--r--main/streams/plain_wrapper.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c
index 52c5e1d1e4..919382aa3c 100644
--- a/main/streams/plain_wrapper.c
+++ b/main/streams/plain_wrapper.c
@@ -208,6 +208,12 @@ PHPAPI php_stream *_php_stream_fopen_from_fd(int fd, const char *mode, const cha
stream->flags |= PHP_STREAM_FLAG_NO_SEEK;
} else {
stream->position = lseek(self->fd, 0, SEEK_CUR);
+#ifdef ESPIPE
+ if (stream->position == (off_t)-1 && errno == ESPIPE) {
+ stream->position = 0;
+ stream->is_pipe = 1;
+ }
+#endif
}
}