[PATCH] mfiutil(8) - capture errors and percolate up to caller

Garrett Cooper yanegomi at gmail.com
Tue Oct 26 18:09:56 UTC 2010


    Because a number of places in the mfiutil(8) code immediately call
warn(3) after an error to an API occurred, and because warn(3) employs
printf, et all (multiple times) in libc, there's an off-chance that
the errno value can get stomped on by the warn(3) calls, which could
lead to confusing results from anyone depending on the value being
returned from the mfiutil APIs. Thus, the attached patch I'm providing
fixes those cases, as well as converts an existing internal API
(display_pending_firmware) to an non-void return mechanism. I also
made a few stack variable alignment changes to match style(9) as well
as got rid of the ad hoc powerof2 call in favor of the value in
sys/param.h.
    I've run a small number of unit tests on my desktop at home with
my mfi(4) card, but will test out other failing cases with equipment I
have access to at work.
Thanks!
-Garrett
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mfiutil-capture-errno-values.patch
Type: text/x-patch
Size: 27618 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20101026/28c2aaca/mfiutil-capture-errno-values.bin


More information about the freebsd-hackers mailing list