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>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
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 <prlw1%cam.ac.uk@localhost>
     Message-ID:  <20180212173001.B23197A187%mollari.NetBSD.org@localhost>
 
   |  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).
 
 kre
 


Home | Main Index | Thread Index | Old Index