Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:36993 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 2050 invoked from network); 13 Apr 2008 22:17:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Apr 2008 22:17:26 -0000 Authentication-Results: pb1.pair.com header.from=greg@chiaraquartet.net; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=greg@chiaraquartet.net; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain chiaraquartet.net from 38.99.98.18 cause and error) X-PHP-List-Original-Sender: greg@chiaraquartet.net X-Host-Fingerprint: 38.99.98.18 beast.bluga.net Linux 2.6 Received: from [38.99.98.18] ([38.99.98.18:35088] helo=mail.bluga.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B0/7B-33575-47682084 for ; Sun, 13 Apr 2008 18:17:25 -0400 Received: from mail.bluga.net (localhost.localdomain [127.0.0.1]) by mail.bluga.net (Postfix) with ESMTP id 90DFEC10F82 for ; Sun, 13 Apr 2008 15:17:22 -0700 (MST) Received: from [192.168.0.106] (CPE-76-84-4-101.neb.res.rr.com [76.84.4.101]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.bluga.net (Postfix) with ESMTP id 5365CC10F81 for ; Sun, 13 Apr 2008 15:17:22 -0700 (MST) Message-ID: <4802868B.2030105@chiaraquartet.net> Date: Sun, 13 Apr 2008 17:17:47 -0500 User-Agent: Thunderbird 2.0.0.12 (X11/20080227) MIME-Version: 1.0 To: internals Mailing List X-Enigmail-Version: 0.95.0 Content-Type: multipart/mixed; boundary="------------030100080302040007060908" X-Virus-Scanned: ClamAV using ClamSMTP Subject: php_stream_display_wrapper_errors issue From: greg@chiaraquartet.net (Gregory Beaver) --------------030100080302040007060908 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Hi, If a stream wrapper does not log errors, by default, we grab strerror(errno) to figure out the error message, but this is not a good idea for any wrapper but plain_wrapper for the obvious reason that errno is not used by wrappers that don't use sys calls. Is this patch against 5.3 acceptable (I'll merge to HEAD on commit if so)? Greg --------------030100080302040007060908 Content-Type: text/plain; name="better_error.patch.txt" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="better_error.patch.txt" Index: main/streams/streams.c =================================================================== RCS file: /repository/php-src/main/streams/streams.c,v retrieving revision 1.82.2.6.2.18.2.7 diff -u -r1.82.2.6.2.18.2.7 streams.c --- main/streams/streams.c 27 Mar 2008 10:33:40 -0000 1.82.2.6.2.18.2.7 +++ main/streams/streams.c 13 Apr 2008 20:41:23 -0000 @@ -164,7 +164,11 @@ free_msg = 1; } else { - msg = strerror(errno); + if (wrapper == &php_plain_files_wrapper) { + msg = strerror(errno); + } else { + msg = "operation failed"; + } } } else { msg = "no suitable wrapper could be found"; --------------030100080302040007060908--