chiark / gitweb /
hid2hci: prepare move to bluez package
authorKay Sievers <kay.sievers@vrfy.org>
Tue, 26 Apr 2011 23:10:04 +0000 (01:10 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Tue, 26 Apr 2011 23:10:04 +0000 (01:10 +0200)
Makefile.am
extras/hid2hci/hid2hci.c

index 2aff45e2a912b937deb3f45341235f5b47bbd99a..5beec9434414b622420b4cdeed88f91e362665d9 100644 (file)
@@ -524,9 +524,9 @@ libexec_PROGRAMS += extras/mobile-action-modeswitch/mobile-action-modeswitch
 # mtd_probe - autoloads FTL module for mtd devices
 # ------------------------------------------------------------------------------
 extras_mtd_probe_mtd_probe_SOURCES =  \
 # mtd_probe - autoloads FTL module for mtd devices
 # ------------------------------------------------------------------------------
 extras_mtd_probe_mtd_probe_SOURCES =  \
-                                                       extras/mtd_probe/mtd_probe.c \
-                                                       extras/mtd_probe/mtd_probe.h \
-                                                       extras/mtd_probe/probe_smartmedia.c
+       extras/mtd_probe/mtd_probe.c \
+       extras/mtd_probe/mtd_probe.h \
+       extras/mtd_probe/probe_smartmedia.c
 
 extras_mtd_probe_mtd_probe_CPPFLAGS = $(AM_CPPFLAGS)
 
 
 extras_mtd_probe_mtd_probe_CPPFLAGS = $(AM_CPPFLAGS)
 
index 98e60d9ac16b664791220f87b8999c7c2c563541..559c6f77b19d08c3e05e2497487b11acb7f324f4 100644 (file)
@@ -2,9 +2,9 @@
  * hid2hci : switch the radio on devices that support
  *           it from HID to HCI and back
  *
  * hid2hci : switch the radio on devices that support
  *           it from HID to HCI and back
  *
- * Copyright (C) 2003-2009  Marcel Holtmann <marcel@holtmann.org>
+ * Copyright (C) 2003-2010  Marcel Holtmann <marcel@holtmann.org>
  * Copyright (C) 2008-2009  Mario Limonciello <mario_limonciello@dell.com>
  * Copyright (C) 2008-2009  Mario Limonciello <mario_limonciello@dell.com>
- * Copyright (C) 2009 Kay Sievers <kay.sievers@vrfy.org>
+ * Copyright (C) 2009-2011 Kay Sievers <kay.sievers@vrfy.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -33,7 +33,6 @@
 #include <usb.h>
 
 #include "libudev.h"
 #include <usb.h>
 
 #include "libudev.h"
-#include "libudev-private.h"
 
 enum mode {
        HCI = 0,
 
 enum mode {
        HCI = 0,
@@ -152,9 +151,8 @@ static int usb_switch_dell(struct usb_dev_handle *dev, enum mode mode)
 }
 
 /*
 }
 
 /*
- * The braindead libusb needs to scan and open all devices, just to
- * to find the device we already have. This needs to be fixed in libusb
- * or it will be ripped out and we carry our own code.
+ * libusb needs to scan and open all devices, just to to find the
+ * device we already have. This should be fixed in libusb.
  */
 static struct usb_device *usb_device_open_from_udev(struct udev_device *usb_dev)
 {
  */
 static struct usb_device *usb_device_open_from_udev(struct udev_device *usb_dev)
 {
@@ -233,7 +231,7 @@ int main(int argc, char *argv[])
        } method = METHOD_UNDEF;
        struct udev *udev;
        struct udev_device *udev_dev = NULL;
        } method = METHOD_UNDEF;
        struct udev *udev;
        struct udev_device *udev_dev = NULL;
-       char syspath[UTIL_PATH_SIZE];
+       char syspath[PATH_MAX];
        int (*usb_switch)(struct usb_dev_handle *dev, enum mode mode) = NULL;
        enum mode mode = HCI;
        const char *devpath = NULL;
        int (*usb_switch)(struct usb_dev_handle *dev, enum mode mode) = NULL;
        enum mode mode = HCI;
        const char *devpath = NULL;
@@ -289,7 +287,7 @@ int main(int argc, char *argv[])
        if (udev == NULL)
                goto exit;
 
        if (udev == NULL)
                goto exit;
 
-       util_strscpyl(syspath, sizeof(syspath), udev_get_sys_path(udev), devpath, NULL);
+       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);
        udev_dev = udev_device_new_from_syspath(udev, syspath);
        if (udev_dev == NULL) {
                fprintf(stderr, "error: could not find '%s'\n", devpath);