svn commit: r224570 - projects/hid/lib/libusbhid

Alexander Motin mav at FreeBSD.org
Mon Aug 1 10:57:54 UTC 2011


Author: mav
Date: Mon Aug  1 10:57:54 2011
New Revision: 224570
URL: http://svn.freebsd.org/changeset/base/224570

Log:
  Return error code via errno in new functions same as in some old.

Modified:
  projects/hid/lib/libusbhid/data.c

Modified: projects/hid/lib/libusbhid/data.c
==============================================================================
--- projects/hid/lib/libusbhid/data.c	Mon Aug  1 09:43:35 2011	(r224569)
+++ projects/hid/lib/libusbhid/data.c	Mon Aug  1 10:57:54 2011	(r224570)
@@ -29,7 +29,6 @@
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
 
-#include <errno.h>
 #include <sys/param.h>
 #include <assert.h>
 #include <stdlib.h>
@@ -128,9 +127,7 @@ hid_get_report(int fd, enum hid_kind k, 
 	ugd.ugd_data = hid_pass_ptr(data);
 	ugd.ugd_maxlen = size;
 	ugd.ugd_report_type = k + 1;
-	if (ioctl(fd, USB_GET_REPORT, &ugd) < 0)
-		return (errno);
-	return (0);
+	return (ioctl(fd, USB_GET_REPORT, &ugd));
 }
 
 int
@@ -142,7 +139,5 @@ hid_set_report(int fd, enum hid_kind k, 
 	ugd.ugd_data = hid_pass_ptr(data);
 	ugd.ugd_maxlen = size;
 	ugd.ugd_report_type = k + 1;
-	if (ioctl(fd, USB_SET_REPORT, &ugd) < 0)
-		return (errno);
-	return (0);
+	return (ioctl(fd, USB_SET_REPORT, &ugd));
 }


More information about the svn-src-projects mailing list