You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by tr...@apache.org on 2001/01/09 05:48:18 UTC
cvs commit: httpd-2.0/support ab.c
trawick 01/01/08 20:48:18
Modified: support ab.c
Log:
get rid of a non-portable use of errno
don't return errno as an error flag after an APR function fails; return
something guaranteed to be non-zero on all platforms
Revision Changes Path
1.47 +3 -3 httpd-2.0/support/ab.c
Index: ab.c
===================================================================
RCS file: /home/cvs/httpd-2.0/support/ab.c,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- ab.c 2000/12/22 00:02:51 1.46
+++ ab.c 2001/01/09 04:48:18 1.47
@@ -896,14 +896,14 @@
static void copyright(void)
{
if (!use_html) {
- printf("This is ApacheBench, Version %s\n", AB_VERSION " <$Revision: 1.46 $> apache-2.0");
+ printf("This is ApacheBench, Version %s\n", AB_VERSION " <$Revision: 1.47 $> apache-2.0");
printf("Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/\n");
printf("Copyright (c) 1998-2000 The Apache Software Foundation, http://www.apache.org/\n");
printf("\n");
}
else {
printf("<p>\n");
- printf(" This is ApacheBench, Version %s <i><%s></i> apache-2.0<br>\n", AB_VERSION, "$Revision: 1.46 $");
+ printf(" This is ApacheBench, Version %s <i><%s></i> apache-2.0<br>\n", AB_VERSION, "$Revision: 1.47 $");
printf(" Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/<br>\n");
printf(" Copyright (c) 1998-2000 The Apache Software Foundation, http://www.apache.org/<br>\n");
printf("</p>\n<p>\n");
@@ -988,7 +988,7 @@
if (apr_open(&postfd, pfile, APR_READ, mode, cntxt) != APR_SUCCESS) {
printf("Invalid postfile name (%s)\n", pfile);
- return errno;
+ return ENOENT;
}
apr_getfileinfo(&finfo, postfd);
Re: cvs commit: httpd-2.0/support ab.c
Posted by Jeff Trawick <tr...@bellsouth.net>.
"William A. Rowe, Jr." <wr...@rowe-clan.net> writes:
> From: trawick@apache.org [mailto:trawick@apache.org]
> Sent: Monday, January 08, 2001 10:48 PM
>
> trawick 01/01/08 20:48:18
>
> Modified: support ab.c
> Log:
> get rid of a non-portable use of errno
>
> @@ -988,7 +988,7 @@
>
> if (apr_open(&postfd, pfile, APR_READ, mode, cntxt) != APR_SUCCESS) {
> printf("Invalid postfile name (%s)\n", pfile);
> - return errno;
> + return ENOENT;
> }
>
> apr_getfileinfo(&finfo, postfd);
>
> Don't you mean APR_ENOENT here?
Hmmm... I can mean that if you want me to :)
There are a couple of other errno values returned explicitly in this
function (have a look at function open_postfile()). I can convert all
three to APR_Exxx. Okay?
and there is another bug in the function (change && to ||)
--
Jeff Trawick | trawickj@bellsouth.net | PGP public key at web site:
http://www.geocities.com/SiliconValley/Park/9289/
Born in Roswell... married an alien...
RE: cvs commit: httpd-2.0/support ab.c
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
From: trawick@apache.org [mailto:trawick@apache.org]
Sent: Monday, January 08, 2001 10:48 PM
trawick 01/01/08 20:48:18
Modified: support ab.c
Log:
get rid of a non-portable use of errno
@@ -988,7 +988,7 @@
if (apr_open(&postfd, pfile, APR_READ, mode, cntxt) != APR_SUCCESS) {
printf("Invalid postfile name (%s)\n", pfile);
- return errno;
+ return ENOENT;
}
apr_getfileinfo(&finfo, postfd);
Don't you mean APR_ENOENT here?