On 01/26/2015 07:00 PM, Laine Stump wrote:
On 01/26/2015 06:04 PM, Eric Blake wrote:
On 01/26/2015 02:56 PM, Laine Stump wrote:
add_link_info() sets an error message when it fails to read /sys/class/net/$dev/operstate, but unfortunately frees the path string just prior to setting the error message, so the error string has "(null)" instead (thanks to glibc's asprintf noticing the null pointer).
- ERR_THROW_STRERROR(!state, ncf, EFILE, "Failed to read %s", path);
- ERR_THROW_STRERROR(!state, ncf, EFILE, "Failed to read %s : %s",
path, strerror);
'strerror' is the address of a function - printing that as a string is probably quite the wrong thing to do. I think you want 'errbuf' here.
Oops. Yeah, that's what my mind was thinking, but my fingers were in a hurry. Proof once again that it's never good to push without a review.
I assume ACK once I fix the bonehead finger fumble?
Yes, the rest looks good, so consider this as ACK.