summaryrefslogtreecommitdiffstats
path: root/src/device.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2013-09-19 08:08:38 +0200
committerGravatar Nikias Bassen2013-09-19 08:08:38 +0200
commit17a5fa85e2978b385448e1a16822cb31ba64e284 (patch)
tree460f759a5a1fbaebc4bec4c073ff167112c721a6 /src/device.c
parentf631e8e055dfcdae440631902ed8a38eb5109cb8 (diff)
downloadusbmuxd-17a5fa85e2978b385448e1a16822cb31ba64e284.tar.gz
usbmuxd-17a5fa85e2978b385448e1a16822cb31ba64e284.tar.bz2
make sure usbmuxd -x does not terminate when unpaired devices are still present
Diffstat (limited to 'src/device.c')
-rw-r--r--src/device.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/device.c b/src/device.c
index 27e25d5..99e0153 100644
--- a/src/device.c
+++ b/src/device.c
@@ -693,21 +693,21 @@ void device_set_visible(int device_id)
} ENDFOREACH
}
-int device_get_count(void)
+int device_get_count(int include_hidden)
{
int count = 0;
FOREACH(struct mux_device *dev, &device_list) {
- if((dev->state == MUXDEV_ACTIVE) && dev->visible)
+ if((dev->state == MUXDEV_ACTIVE) && (include_hidden || dev->visible))
count++;
} ENDFOREACH
return count;
}
-int device_get_list(struct device_info *p)
+int device_get_list(int include_hidden, struct device_info *p)
{
int count = 0;
FOREACH(struct mux_device *dev, &device_list) {
- if((dev->state == MUXDEV_ACTIVE) && dev->visible) {
+ if((dev->state == MUXDEV_ACTIVE) && (include_hidden || dev->visible)) {
p->id = dev->id;
p->serial = usb_get_serial(dev->usbdev);
p->location = usb_get_location(dev->usbdev);