apr-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 44971] New: apr_getservbyname has invalid return value on some UNIX variants
Date Mon, 12 May 2008 10:27:43 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=44971

           Summary: apr_getservbyname has invalid return value on some UNIX
                    variants
           Product: APR
           Version: HEAD
          Platform: All
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P3
         Component: APR
        AssignedTo: bugs@apr.apache.org
        ReportedBy: ctaylor@wadeford.plus.com


On HP-UX, linux and Solaris (NOT Aix or Tru64 though) getservbyname doesnt set
an errno when a lookup fails.  The apr_getservbyname function returns
APR_SUCCESS if the lookup succeeds, and errno if it doesnt.  Because the errno
is zero (the same as APR_SUCCESS), calling functions think that the
apr_getservbyname has succeeded, when it has actually failed.  

I would suggest setting errno to ENOENT if the lookup failed and errno is zero,
and changing the return value to "errno + APR_OS_START_SYSERR" to be consistant
with other apr api calls in this area.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@apr.apache.org
For additional commands, e-mail: bugs-help@apr.apache.org


Mime
View raw message