diff options
author | jhb <jhb@FreeBSD.org> | 2011-03-17 21:24:32 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2011-03-17 21:24:32 +0000 |
commit | 1ad2b561109c6521ad0385ceeb1aefa4cd6308f4 (patch) | |
tree | 16d760c143433b2235fbb03cd52d02e2001e1456 | |
parent | 66e5107b571ac3e5cd2a0b66c0d805d2e6072201 (diff) | |
download | FreeBSD-src-1ad2b561109c6521ad0385ceeb1aefa4cd6308f4.zip FreeBSD-src-1ad2b561109c6521ad0385ceeb1aefa4cd6308f4.tar.gz |
Preserve errno in an error case.
Submitted by: gcooper
-rw-r--r-- | usr.sbin/mfiutil/mfi_show.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/mfiutil/mfi_show.c b/usr.sbin/mfiutil/mfi_show.c index 8b227b8..b09bed7 100644 --- a/usr.sbin/mfiutil/mfi_show.c +++ b/usr.sbin/mfiutil/mfi_show.c @@ -174,8 +174,9 @@ show_battery(int ac, char **av) if (mfi_dcmd_command(fd, MFI_DCMD_BBU_GET_STATUS, &stat, sizeof(stat), NULL, 0, NULL) < 0) { + error = errno; warn("Failed to get status"); - return (errno); + return (error); } printf("mfi%d: Battery State:\n", mfi_unit); |