cvs: php4 /main streams.c
| From: | Wez Furlong | Date: | Sun, 25 Aug 2002 11:02:05 +0000 |
| Subject: | cvs: php4 /main streams.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-13657@lists.php.net to get a copy of this message | ||
wez Sun Aug 25 07:02:05 2002 EDT
Modified files:
/php4/main streams.c
Log:
Potential fix for Bug#18022:
Streams that are pipes on systems that HAVE_FLUSHIO should not be seeked
as is required for plain files on those systems.
Index: php4/main/streams.c
diff -u php4/main/streams.c:1.70 php4/main/streams.c:1.71
--- php4/main/streams.c:1.70 Sun Aug 25 06:36:08 2002
+++ php4/main/streams.c Sun Aug 25 07:02:05 2002
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: streams.c,v 1.70 2002/08/25 10:36:08 wez Exp $ */
+/* $Id: streams.c,v 1.71 2002/08/25 11:02:05 wez Exp $ */
#define _GNU_SOURCE
#include "php.h"
@@ -774,7 +774,7 @@
assert(data != NULL);
#if HAVE_FLUSHIO
- if (data->last_op == 'r') {
+ if (!data->is_pipe && data->last_op == 'r') {
fseek(data->file, 0, SEEK_CUR);
}
data->last_op = 'w';
@@ -798,7 +798,7 @@
}
#if HAVE_FLUSHIO
- if (data->last_op == 'w')
+ if (!data->is_pipe && data->last_op == 'w')
fseek(data->file, 0, SEEK_CUR);
data->last_op = 'r';
#endif
@@ -856,7 +856,7 @@
assert(data != NULL);
#if HAVE_FLUSHIO
- if (data->last_op == 'w') {
+ if (!data->is_pipe && data->last_op == 'w') {
fseek(data->file, 0, SEEK_CUR);
}
data->last_op = 'r';