Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 13053 invoked by uid 6000); 21 Oct 1999 15:25:05 -0000 Received: (qmail 13046 invoked from network); 21 Oct 1999 15:25:03 -0000 Received: from fwns1d.raleigh.ibm.com (HELO fwns1.raleigh.ibm.com) (204.146.167.235) by taz.hyperreal.org with SMTP; 21 Oct 1999 15:25:03 -0000 Received: from rtpmail01.raleigh.ibm.com (rtpmail01.raleigh.ibm.com [9.37.172.24]) by fwns1.raleigh.ibm.com (8.9.0/8.9.0/RTP-FW-1.2) with ESMTP id LAA31452 for ; Thu, 21 Oct 1999 11:24:32 -0400 Received: from chosondo.raleigh.ibm.com (chosondo.raleigh.ibm.com [9.37.73.195]) by rtpmail01.raleigh.ibm.com (8.8.5/8.8.5/RTP-ral-1.1) with ESMTP id LAA35242 for ; Thu, 21 Oct 1999 11:24:33 -0400 Date: Thu, 21 Oct 1999 11:24:30 -0400 (EDT) From: Ryan Bloom To: "new-httpd@apache.org" Subject: Re: Change to Error logging routines. In-Reply-To: <199910211506.BAA28946@silk.apana.org.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org > In the OS/2 header files there's a constant ERROR_USER_DEFINED_BASE (set at > 0xFF00) which all system error codes are less than. I'm not sure what you > guys are getting at though, I can't see what use it would be for APR > functions to return system error codes as nothing would understand them. But, the goal is to have them understood. Right now, we check for errors, rather than checking for success. We do that because in POSIX, checking for errors is just easier. With APR_SUCCESS, we can check for success in all cases, and use portable API's to deal with the errors. For example, this code should work regardless of what platform it's on. (Assume valid types throught) if ((status = ap_readdir(temp)) != APR_SUCCESS) { ap_log(APLOG_MARK, ... , status, ....); } In ap_log, we use the equivalent of strerror on all platforms to output a meaningful error message. There are places, where we actually need to know which error was returned to do the right thing, but they are few and far between (I seem to remember one in the old http_main.c), and these can be #ifdef'ed cleanly. The most common uses for errno, was to see if there was a problem, and for logging. Both of those functions can be taken care of by APR. I'm not saying that we can get rid of all uses of platform specific error codes, but we can get rid of a bunch of them. Take a look at the new apr_errno.h, and see what you think. Ryan _______________________________________________________________________ Ryan Bloom rbb@raleigh.ibm.com 4205 S Miami Blvd RTP, NC 27709 It's a beautiful sight to see good dancers doing simple steps. It's a painful sight to see beginners doing complicated patterns.