Re: [Boost-bugs] [Boost C++ Libraries] #7530: do_epoll_create : errno is manually set to EINVAL, causes problems downstream

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7530: do_epoll_create : errno is manually set to EINVAL, causes problems downstream
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-10-19 14:16:55


#7530: do_epoll_create : errno is manually set to EINVAL, causes problems
downstream
--------------------------------------+-------------------------------------
  Reporter: launchpadmike@… | Owner: chris_kohlhoff
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: asio
   Version: Boost 1.51.0 | Severity: Problem
Resolution: | Keywords:
--------------------------------------+-------------------------------------

Comment (by launchpadmike@…):

 Please close the ticket. The problems seen downstream in our code base
 were do to the use of strtol. According to strtol documentation, errno
 must be set to 0 before it is called (due to its return values not
 necessarily indicating that an error has taken place)

 From the strtol manpage:
 "Since strtol() can legitimately return 0, LONG_MAX, or LONG_MIN
 (LLONG_MAX or LLONG_MIN for strtoll()) on both success and failure, the
 calling program should set errno to 0 before the call, and then determine
 if an error occurred by checking whether errno has a nonzero value after
 the call."

 We were not setting errno to 0 before calling strtol, and on checking the
 value of errno it was giving EINVAL (which had been set earlier in
 do_epoll_create, causing the confusion.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7530#comment:3>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:10 UTC