From owner-svn-src-stable-8@FreeBSD.ORG Wed Oct 12 06:40:49 2011 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A0B71106566C; Wed, 12 Oct 2011 06:40:49 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75FCC8FC16; Wed, 12 Oct 2011 06:40:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id p9C6enwN050970; Wed, 12 Oct 2011 06:40:49 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p9C6enCw050966; Wed, 12 Oct 2011 06:40:49 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201110120640.p9C6enCw050966@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 12 Oct 2011 06:40:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r226282 - stable/8/lib/libusb X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2011 06:40:49 -0000 Author: hselasky Date: Wed Oct 12 06:40:49 2011 New Revision: 226282 URL: http://svn.freebsd.org/changeset/base/226282 Log: MFC r226220 Fix libusb compliance. Modified: stable/8/lib/libusb/libusb.3 stable/8/lib/libusb/libusb10.c stable/8/lib/libusb/libusb20.3 Directory Properties: stable/8/lib/libusb/ (props changed) stable/8/lib/libusb/usb.h (props changed) Modified: stable/8/lib/libusb/libusb.3 ============================================================================== --- stable/8/lib/libusb/libusb.3 Wed Oct 12 06:40:21 2011 (r226281) +++ stable/8/lib/libusb/libusb.3 Wed Oct 12 06:40:49 2011 (r226282) @@ -223,8 +223,8 @@ code on failure. .Ft int .Fn libusb_kernel_driver_active "libusb_device_handle *devh" "int interface" Determine if a driver is active on a interface. -Returns 0 if no kernel driver -is active, 1 if a kernel driver is active, LIBUSB_ERROR_NO_DEVICE +Returns 0 if no kernel driver is active +and 1 if a kernel driver is active, LIBUSB_ERROR_NO_DEVICE if the device has been disconnected and a LIBUSB_ERROR code on failure. .Pp .Ft int Modified: stable/8/lib/libusb/libusb10.c ============================================================================== --- stable/8/lib/libusb/libusb10.c Wed Oct 12 06:40:21 2011 (r226281) +++ stable/8/lib/libusb/libusb10.c Wed Oct 12 06:40:49 2011 (r226282) @@ -216,7 +216,6 @@ libusb_get_device_list(libusb_context *c libusb20_be_free(usb_backend); return (LIBUSB_ERROR_NO_MEM); } - /* get device into libUSB v1.0 list */ libusb20_be_dequeue_device(usb_backend, pdev); @@ -718,8 +717,10 @@ libusb_kernel_driver_active(struct libus if (pdev == NULL) return (LIBUSB_ERROR_INVALID_PARAM); - return (libusb20_dev_kernel_driver_active( - pdev, interface)); + if (libusb20_dev_kernel_driver_active(pdev, interface)) + return (0); /* no kernel driver is active */ + else + return (1); /* kernel driver is active */ } int Modified: stable/8/lib/libusb/libusb20.3 ============================================================================== --- stable/8/lib/libusb/libusb20.3 Wed Oct 12 06:40:21 2011 (r226281) +++ stable/8/lib/libusb/libusb20.3 Wed Oct 12 06:40:49 2011 (r226282) @@ -614,10 +614,9 @@ The file descriptor can be used for poll .Pp . .Fn libusb20_dev_kernel_driver_active -returns a non-zero value if a kernel driver is active on -the given USB interface. +returns zero if a kernel driver is active on the given USB interface. . -Else zero is returned. +Else a LIBUSB20_ERROR value is returned. . .Pp .