Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:8818 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 59079 invoked by uid 1010); 28 Mar 2004 14:58:08 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 59034 invoked from network); 28 Mar 2004 14:58:07 -0000 Received: from unknown (HELO sco.theporch.com) (207.65.119.4) by pb1.pair.com with SMTP; 28 Mar 2004 14:58:07 -0000 Received: from sco (root@ns1.theporch.com [207.65.119.4]) by sco.theporch.com (8.13.0.Alpha0/8.13.0.Alpha0) with ESMTP id i2SEwIKQ002284 for ; Sun, 28 Mar 2004 08:58:18 -0600 (CST) Date: Sun, 28 Mar 2004 08:58:18 -0600 (CST) To: internals@lists.php.net Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Subject: PHP-4.3.5 problem From: root@theporch.com (Phillip Porch) There seems to be a problem in the streams.c code. There is a line that has the construct #if defined(S_ISFIFO) || defined(S_ISSOCK) the problem is the the code below assumes that S_ISSOCK is defined but the if statement is true if either S_ISFIFO or S_ISSOCK is defined. If you have a system (like I do) that defines S_ISFIFO but not S_ISSOCK, the code fails. I looked at the PHP-4.3.4 code and munged the code as per the patch below to make it compile. Someone might want to look at this further. Thanks, *** streams.c Tue Mar 16 17:23:25 2004 --- streams.c.new Sun Mar 28 08:06:00 2004 *************** *** 2016,2022 **** { php_stdio_stream_data *self; php_stream *stream; ! #if defined(S_ISFIFO) || defined(S_ISSOCK) struct stat sb; int stat_ok; --- 2016,2022 ---- { php_stdio_stream_data *self; php_stream *stream; ! #if defined(S_ISFIFO) && defined(S_ISSOCK) struct stat sb; int stat_ok; *************** *** 2037,2044 **** #ifdef S_ISFIFO /* detect if this is a pipe */ ! if (stat_ok) { ! self->is_pipe = S_ISFIFO(sb.st_mode) ? 1 : 0; } #elif defined(PHP_WIN32) { --- 2037,2045 ---- #ifdef S_ISFIFO /* detect if this is a pipe */ ! if (self->fd >= 0) { ! struct stat sb; ! self->is_pipe = (fstat(self->fd, &sb) == 0 && S_ISFIFO(sb.st_mode)) ? 1 : 0; } #elif defined(PHP_WIN32) { -- Phillip P. Porch NIC:PP1573 finger for http://www.theporch.com 36 1.187 N 86 44.018 W GnuPG key