svn commit: r219722 - head/usr.sbin/mfiutil

John Baldwin jhb at FreeBSD.org
Thu Mar 17 21:24:33 UTC 2011


Author: jhb
Date: Thu Mar 17 21:24:32 2011
New Revision: 219722
URL: http://svn.freebsd.org/changeset/base/219722

Log:
  Preserve errno in an error case.
  
  Submitted by:	gcooper

Modified:
  head/usr.sbin/mfiutil/mfi_show.c

Modified: head/usr.sbin/mfiutil/mfi_show.c
==============================================================================
--- head/usr.sbin/mfiutil/mfi_show.c	Thu Mar 17 21:02:14 2011	(r219721)
+++ head/usr.sbin/mfiutil/mfi_show.c	Thu Mar 17 21:24:32 2011	(r219722)
@@ -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);


More information about the svn-src-head mailing list