Preserve errno in an error case.

Submitted by:	gcooper
This commit is contained in:
John Baldwin 2011-03-17 21:24:32 +00:00
parent 8d7dcf14ff
commit b09e402ad0
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=219722

View File

@ -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);