You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by "William A. Rowe, Jr." <wr...@apache.org> on 2002/12/30 00:23:33 UTC

Re: cvs commit: apr/include apr_errno.h

This patch comes up just a bit short.

Because a user *may* choose to use the explicit value APR_ESYMNOTFOUND,
the test APR_STATUS_IS_ESYMNOTFOUND must always include it, as well
as any platform-specific values.

What about other cases as well, such as 'not a module' (invalid format)?

Bill


At 04:50 PM 12/29/2002, rbb@apache.org wrote:
>rbb         2002/12/29 14:50:13
>
>  Modified:    include  apr_errno.h
>  Log:
>  Get the new DSO error values working on Windows.  Windows now passes all
>  DSO tests.
>  
>  Revision  Changes    Path
>  1.107     +8 -0      apr/include/apr_errno.h
>  
>  Index: apr_errno.h
>  ===================================================================
>  RCS file: /home/cvs/apr/include/apr_errno.h,v
>  retrieving revision 1.106
>  retrieving revision 1.107
>  diff -u -r1.106 -r1.107
>  --- apr_errno.h       29 Dec 2002 22:31:45 -0000      1.106
>  +++ apr_errno.h       29 Dec 2002 22:50:13 -0000      1.107
>  @@ -369,7 +369,11 @@
>    * APR was unable to open the dso object.  
>    * For more information call apr_dso_error().
>    */
>  +#if defined(WIN32)
>  +#define APR_STATUS_IS_EDSOOPEN(s)       (APR_TO_OS_ERROR(s) == ERROR_MOD_NOT_FOUND)
>  +#else
>   #define APR_STATUS_IS_EDSOOPEN(s)       ((s) == APR_EDSOOPEN)
>  +#endif
>   /** The given path was absolute. */
>   #define APR_STATUS_IS_EABSOLUTE(s)      ((s) == APR_EABSOLUTE)
>   /** The given path was relative. */
>  @@ -383,7 +387,11 @@
>   /** The given path contained wildcards. */
>   #define APR_STATUS_IS_EPATHWILD(s)      ((s) == APR_EPATHWILD)
>   /** Could not find the requested symbol. */
>  +#if defined(WIN32)
>  +#define APR_STATUS_IS_ESYMNOTFOUND(s)   (APR_TO_OS_ERROR(s) == ERROR_PROC_NOT_FOUND)
>  +#else
>   #define APR_STATUS_IS_ESYMNOTFOUND(s)   ((s) == APR_ESYMNOTFOUND)
>  +#endif
>   
>   /* APR STATUS VALUES */
>   /** @see APR_STATUS_IS_INCHILD */
>  
>  
>  


Re: cvs commit: apr/include apr_errno.h

Posted by "William A. Rowe, Jr." <wr...@apache.org>.
At 05:50 PM 12/29/2002, rbb@apache.org wrote:

>On Sun, 29 Dec 2002, William A. Rowe, Jr. wrote:
>
>> This patch comes up just a bit short.
>>
>> Because a user *may* choose to use the explicit value APR_ESYMNOTFOUND,
>> the test APR_STATUS_IS_ESYMNOTFOUND must always include it, as well
>> as any platform-specific values.
>
>What user?  The only thing that ever sets a value to ESYMNOTFOUND is APR
>itself.  On Windows, we don't use that value, so we don't test for it.

You've never used the construct;

    if (xxxcondition) {
        rv = APR_EFOO;
    }
    else {
        rv = apr_foo_fn(somefn);
    }

to express the fact that you are skipping a call?  If APR_EFOO is defined,
then APR_STATUS_IS_EFOO(APR_EFOO) must resolve to true.

Of course you could have simply #defined APR_EFOO as PLATFORM_RES
and therefore satisfied the requirement above and your desire to fix the test.


Re: cvs commit: apr/include apr_errno.h

Posted by Justin Erenkrantz <je...@apache.org>.
--On Sunday, December 29, 2002 3:50 PM -0800 rbb@apache.org wrote:

>> What about other cases as well, such as 'not a module' (invalid
>> format)?
>
> Find a platform that can return such a value, and we will have to
> take it into account.  Currently, this gets us passing the test

While I'm not really clear what either of you mean here, the Darwin 
dyld code can return an error for 'invalid format' - in fact, we use 
that as a hint to use the alternative Darwin dso calls.  I don't 
think that code currently gets returned to the user though.  -- justin

Re: cvs commit: apr/include apr_errno.h

Posted by rb...@apache.org.

On Sun, 29 Dec 2002, William A. Rowe, Jr. wrote:

> This patch comes up just a bit short.
>
> Because a user *may* choose to use the explicit value APR_ESYMNOTFOUND,
> the test APR_STATUS_IS_ESYMNOTFOUND must always include it, as well
> as any platform-specific values.

What user?  The only thing that ever sets a value to ESYMNOTFOUND is APR
itself.  On Windows, we don't use that value, so we don't test for it.

> What about other cases as well, such as 'not a module' (invalid format)?

Find a platform that can return such a value, and we will have to take it
into account.  Currently, this gets us passing the test suite again, which
was my current goal.  When we write more tests that can fail in more ways,
we will most likely need more error codes.

Ryan

>
> Bill
>
>
> At 04:50 PM 12/29/2002, rbb@apache.org wrote:
> >rbb         2002/12/29 14:50:13
> >
> >  Modified:    include  apr_errno.h
> >  Log:
> >  Get the new DSO error values working on Windows.  Windows now passes all
> >  DSO tests.
> >
> >  Revision  Changes    Path
> >  1.107     +8 -0      apr/include/apr_errno.h
> >
> >  Index: apr_errno.h
> >  ===================================================================
> >  RCS file: /home/cvs/apr/include/apr_errno.h,v
> >  retrieving revision 1.106
> >  retrieving revision 1.107
> >  diff -u -r1.106 -r1.107
> >  --- apr_errno.h       29 Dec 2002 22:31:45 -0000      1.106
> >  +++ apr_errno.h       29 Dec 2002 22:50:13 -0000      1.107
> >  @@ -369,7 +369,11 @@
> >    * APR was unable to open the dso object.
> >    * For more information call apr_dso_error().
> >    */
> >  +#if defined(WIN32)
> >  +#define APR_STATUS_IS_EDSOOPEN(s)       (APR_TO_OS_ERROR(s) == ERROR_MOD_NOT_FOUND)
> >  +#else
> >   #define APR_STATUS_IS_EDSOOPEN(s)       ((s) == APR_EDSOOPEN)
> >  +#endif
> >   /** The given path was absolute. */
> >   #define APR_STATUS_IS_EABSOLUTE(s)      ((s) == APR_EABSOLUTE)
> >   /** The given path was relative. */
> >  @@ -383,7 +387,11 @@
> >   /** The given path contained wildcards. */
> >   #define APR_STATUS_IS_EPATHWILD(s)      ((s) == APR_EPATHWILD)
> >   /** Could not find the requested symbol. */
> >  +#if defined(WIN32)
> >  +#define APR_STATUS_IS_ESYMNOTFOUND(s)   (APR_TO_OS_ERROR(s) == ERROR_PROC_NOT_FOUND)
> >  +#else
> >   #define APR_STATUS_IS_ESYMNOTFOUND(s)   ((s) == APR_ESYMNOTFOUND)
> >  +#endif
> >
> >   /* APR STATUS VALUES */
> >   /** @see APR_STATUS_IS_INCHILD */
> >
> >
> >
>
>