On Sun, Oct 3, 2010 at 8:30 PM, Garrett Cooper <yaneg...@gmail.com> wrote: > As discussed offlist with some of the Yahoo! FreeBSD folks, > mfiutil catches errors, but doesn't communicate it back up to the > executing process. Examples follow... > Before: > > $ ./mfiutil show adapter > mfiutil: mfi_open: Permission denied > $ echo $? > 0 > > (I would expect it to exit with a non-zero exit code) > After: > > $ ./mfiutil show adapter > mfiutil: mfi_open: Permission denied > $ echo $? > 1 > > (Much better!) > > $ sudo ./mfiutil show adapter > mfi0 Adapter: > Product Name: MegaRAID SAS 8704ELP > Serial Number: P391734409 > Firmware: 11.0.1-0026 > RAID Levels: JBOD, RAID0, RAID1, RAID5, RAID6, RAID10, RAID50 > Battery Backup: present > NVRAM: 32K > Onboard Memory: 128M > Minimum Stripe: 8K > Maximum Stripe: 1M > $ echo $? > 0 > > (Looks good too!) > > After (mptutil): > > $ ../mptutil/mptutil show adapter > mptutil: mpt_open: No such file or directory > $ echo $? > 1 > > (Well, I don't have a mpt(4) card, so...) > > This trivial patch fixes this code to report valid errors in the > handlers. I've added code to catch errors with mptutil as well as the > logic is basically the same, and it functions as expected in the > negative case; I don't have the hardware to test the mptutil command > in the positive case though to ensure that functions as expected. > Thanks!
Adding hackers@ for visibility with mptutil. Thanks, -Garrett
mptutil-capture-handler-errors.diff
Description: Binary data
mfiutil-capture-handler-errors.diff
Description: Binary data
_______________________________________________ freebsd-hackers@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-hackers To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"