NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/53015: dhcpd fails to start in -current

The following reply was made to PR bin/53015; it has been noted by GNATS.

From: Robert Elz <kre%munnari.OZ.AU@localhost>
Subject: Re: bin/53015: dhcpd fails to start in -current
Date: Tue, 13 Feb 2018 03:26:50 +0700

     Date:        Mon, 12 Feb 2018 17:30:01 +0000 (UTC)
     From:        Patrick Welche <>
     Message-ID:  <>
   |  Actually malloc() should set errno. Thing is, gdb shows it to be zero.
 There are paths through malloc (both jemalloc, which is generally the one
 in use, and the other one .. though I think different paths) where it can
 return NULL and not set errno.
 However anything which is relying upon testiing errno (except in the very
 few cases where it is defined to work that way) to determine if there is
 a problem is broken ... use whatever other means the function specifies
 to determine whether it worked or not (eg: NULL from malloc()) and then
 if it failed, errno can be used as an aid to help work out why (including the
 cases when errno == 0).

Home | Main Index | Thread Index | Old Index