[Pkg-bluetooth-commits] r1069 - /packages/bluez/trunk/debian/patches/03-Fix-return-code-of-hid2hci.patch

iwamatsu at users.alioth.debian.org iwamatsu at users.alioth.debian.org
Thu Jun 9 04:47:33 UTC 2011


Author: iwamatsu
Date: Thu Jun  9 04:47:33 2011
New Revision: 1069

URL: http://svn.debian.org/wsvn/pkg-bluetooth/?sc=1&rev=1069
Log:
Add 03-Fix-return-code-of-hid2hci.patch
This fix return code of hid2hci.


Added:
    packages/bluez/trunk/debian/patches/03-Fix-return-code-of-hid2hci.patch

Added: packages/bluez/trunk/debian/patches/03-Fix-return-code-of-hid2hci.patch
URL: http://svn.debian.org/wsvn/pkg-bluetooth/packages/bluez/trunk/debian/patches/03-Fix-return-code-of-hid2hci.patch?rev=1069&op=file
==============================================================================
--- packages/bluez/trunk/debian/patches/03-Fix-return-code-of-hid2hci.patch (added)
+++ packages/bluez/trunk/debian/patches/03-Fix-return-code-of-hid2hci.patch Thu Jun  9 04:47:33 2011
@@ -1,0 +1,69 @@
+From 244c2206d5ff0893f7500e17dc30af98ce779fec Mon Sep 17 00:00:00 2001
+From: Nobuhiro Iwamatsu <iwamatsu at nigauri.org>
+Date: Thu, 9 Jun 2011 12:54:17 +0900
+Subject: [PATCH] Fix return code of hid2hci
+
+hid2hci already return 1.
+This set 0 to default retuen code and add error code.
+---
+ tools/hid2hci.c |   10 ++++++++--
+ 1 files changed, 8 insertions(+), 2 deletions(-)
+
+diff --git a/tools/hid2hci.c b/tools/hid2hci.c
+index 45a3a3d..da278cb 100644
+--- a/tools/hid2hci.c
++++ b/tools/hid2hci.c
+@@ -240,7 +240,7 @@ int main(int argc, char *argv[])
+ 	enum mode mode = HCI;
+ 	const char *devpath = NULL;
+ 	int err = -1;
+-	int rc = 1;
++	int rc = 0;
+ 
+ 	for (;;) {
+ 		int option;
+@@ -288,13 +288,16 @@ int main(int argc, char *argv[])
+ 	}
+ 
+ 	udev = udev_new();
+-	if (udev == NULL)
++	if (udev == NULL) {
++		rc = errno;
+ 		goto exit;
++	}
+ 
+ 	snprintf(syspath, sizeof(syspath), "%s/%s", udev_get_sys_path(udev), devpath);
+ 	udev_dev = udev_device_new_from_syspath(udev, syspath);
+ 	if (udev_dev == NULL) {
+ 		fprintf(stderr, "error: could not find '%s'\n", devpath);
++		rc = errno;
+ 		goto exit;
+ 	}
+ 
+@@ -312,6 +315,7 @@ int main(int argc, char *argv[])
+ 			dev = udev_device_get_parent_with_subsystem_devtype(dev, "usb", "usb_device");
+ 			if (dev == NULL) {
+ 				fprintf(stderr, "error: could not find usb_device for '%s'\n", devpath);
++				rc = errno;
+ 				goto exit;
+ 			}
+ 		}
+@@ -320,6 +324,7 @@ int main(int argc, char *argv[])
+ 		if (handle == NULL) {
+ 			fprintf(stderr, "error: unable to handle '%s'\n",
+ 				udev_device_get_syspath(dev));
++			rc = errno;
+ 			goto exit;
+ 		}
+ 		err = usb_switch(handle, mode);
+@@ -331,6 +336,7 @@ int main(int argc, char *argv[])
+ 		device = udev_device_get_devnode(udev_dev);
+ 		if (device == NULL) {
+ 			fprintf(stderr, "error: could not find hiddev device node\n");
++			rc = errno;
+ 			goto exit;
+ 		}
+ 		err = hid_switch_logitech(device);
+-- 
+1.7.5.3
+




More information about the Pkg-bluetooth-commits mailing list