apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rpl...@apache.org
Subject svn commit: r727605 - in /apr/apr/branches/1.3.x: CHANGES strings/apr_strings.c
Date Thu, 18 Dec 2008 01:01:54 GMT
Author: rpluem
Date: Wed Dec 17 17:01:54 2008
New Revision: 727605

URL: http://svn.apache.org/viewvc?rev=727605&view=rev
Log:
Merge r727052 from trunk:

* Similar to apr_strtoff reset errno to zero in apr_strtoi64.
  Cases were observed where apr_strtoi64 returned with a
  previously set errno although the operation worked fine.

Submitted by: rpluem
Reviewed by: rpluem

Modified:
    apr/apr/branches/1.3.x/CHANGES
    apr/apr/branches/1.3.x/strings/apr_strings.c

Modified: apr/apr/branches/1.3.x/CHANGES
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.3.x/CHANGES?rev=727605&r1=727604&r2=727605&view=diff
==============================================================================
--- apr/apr/branches/1.3.x/CHANGES [utf-8] (original)
+++ apr/apr/branches/1.3.x/CHANGES [utf-8] Wed Dec 17 17:01:54 2008
@@ -1,6 +1,9 @@
                                                      -*- coding: utf-8 -*-
 Changes for APR 1.3.4
 
+  *) Reset errno to zero in apr_strtoi64 to prevent returning an errno not
+     equal zero in cases where the operation worked fine. [Ruediger Pluem]
+
   *) Win32: Do not error out on apr_pollset_poll() when there are no sockets.
      [Justin Erenkrantz]
 

Modified: apr/apr/branches/1.3.x/strings/apr_strings.c
URL: http://svn.apache.org/viewvc/apr/apr/branches/1.3.x/strings/apr_strings.c?rev=727605&r1=727604&r2=727605&view=diff
==============================================================================
--- apr/apr/branches/1.3.x/strings/apr_strings.c (original)
+++ apr/apr/branches/1.3.x/strings/apr_strings.c Wed Dec 17 17:01:54 2008
@@ -245,6 +245,7 @@
 APR_DECLARE(apr_int64_t) apr_strtoi64(const char *nptr, char **endptr, int base)
 {
 #ifdef APR_INT64_STRFN
+    errno = 0;
     return APR_INT64_STRFN(nptr, endptr, base);
 #else
     const char *s;
@@ -253,6 +254,7 @@
     int neg, any;
     char c;
 
+    errno = 0;
     /*
      * Skip white space and pick up leading +/- sign if any.
      * If base is 0, allow 0x for hex and 0 for octal, else



Mime
View raw message