summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@beiboot.suse.de>2016-02-07 20:55:54 +0100
committerMarcus Meissner <marcus@beiboot.suse.de>2016-02-07 20:55:54 +0100
commit1f95b3dce412cc4d696220cea1be8d8d1feba6a7 (patch)
tree470cb717775fc597013766fbbfd10a367a1f419d
parent96535e95a1d8ecbdbec90619b5402ad65886b417 (diff)
downloadlibgphoto2-1f95b3dce412cc4d696220cea1be8d8d1feba6a7.tar.gz
do not check the return of the gp_port_info_list_append in generic
case, as it might be -1
-rw-r--r--libgphoto2_port/disk/disk.c2
-rw-r--r--libgphoto2_port/libusb1/libusb1.c2
-rw-r--r--libgphoto2_port/ptpip/ptpip.c2
-rw-r--r--libgphoto2_port/serial/unix.c9
-rw-r--r--libgphoto2_port/usb/libusb.c2
-rw-r--r--libgphoto2_port/vusb/vusb.c2
6 files changed, 13 insertions, 6 deletions
diff --git a/libgphoto2_port/disk/disk.c b/libgphoto2_port/disk/disk.c
index 1a3246962..35f55147d 100644
--- a/libgphoto2_port/disk/disk.c
+++ b/libgphoto2_port/disk/disk.c
@@ -306,7 +306,7 @@ gp_port_library_list (GPPortInfoList *list)
gp_port_info_set_type (info, GP_PORT_DISK);
gp_port_info_set_name (info, "");
gp_port_info_set_path (info, "^disk:");
- CHECK (gp_port_info_list_append (list, info));
+ gp_port_info_list_append (list, info); /* do not check return */
return GP_OK;
}
diff --git a/libgphoto2_port/libusb1/libusb1.c b/libgphoto2_port/libusb1/libusb1.c
index 2f671ba5a..6a333586a 100644
--- a/libgphoto2_port/libusb1/libusb1.c
+++ b/libgphoto2_port/libusb1/libusb1.c
@@ -195,7 +195,7 @@ gp_port_library_list (GPPortInfoList *list)
gp_port_info_set_type (info, GP_PORT_USB);
gp_port_info_set_name (info, "");
gp_port_info_set_path (info, "^usb:");
- C_GP (gp_port_info_list_append (list, info));
+ gp_port_info_list_append (list, info); /* do not check return value, it might be -1 */
nrofdevs = libusb_get_device_list (ctx, &devs);
C_MEM (descs = calloc (nrofdevs, sizeof(descs[0])));
diff --git a/libgphoto2_port/ptpip/ptpip.c b/libgphoto2_port/ptpip/ptpip.c
index 6a63495fd..3b60d8a37 100644
--- a/libgphoto2_port/ptpip/ptpip.c
+++ b/libgphoto2_port/ptpip/ptpip.c
@@ -183,7 +183,7 @@ gp_port_library_list (GPPortInfoList *list)
gp_port_info_set_type (info, GP_PORT_PTPIP);
gp_port_info_set_name (info, "");
gp_port_info_set_path (info, "^ptpip:");
- CHECK (gp_port_info_list_append (list, info));
+ gp_port_info_list_append (list, info); /* do not check return */
#ifdef HAVE_MDNS_BONJOUR
ret = DNSServiceBrowse (
diff --git a/libgphoto2_port/serial/unix.c b/libgphoto2_port/serial/unix.c
index 30df35747..0b6876e0a 100644
--- a/libgphoto2_port/serial/unix.c
+++ b/libgphoto2_port/serial/unix.c
@@ -348,9 +348,16 @@ gp_port_library_list (GPPortInfoList *list)
*/
gp_port_info_new (&info);
gp_port_info_set_type (info, GP_PORT_SERIAL);
+ gp_port_info_set_path (info, "serial:");
+ gp_port_info_set_name (info, _("Serial Port Device"));
+ CHECK (gp_port_info_list_append (list, info));
+
+ gp_port_info_new (&info);
+ gp_port_info_set_type (info, GP_PORT_SERIAL);
gp_port_info_set_path (info, "^serial:");
gp_port_info_set_name (info, "");
- return gp_port_info_list_append (list, info);
+ gp_port_info_list_append (list, info); /* do not check */
+ return GP_OK;
}
static int
diff --git a/libgphoto2_port/usb/libusb.c b/libgphoto2_port/usb/libusb.c
index 94cbca970..97d5a5736 100644
--- a/libgphoto2_port/usb/libusb.c
+++ b/libgphoto2_port/usb/libusb.c
@@ -91,7 +91,7 @@ gp_port_library_list (GPPortInfoList *list)
gp_port_info_set_type (info, GP_PORT_USB);
gp_port_info_set_name (info, "");
gp_port_info_set_path (info, "^usb:");
- CHECK (gp_port_info_list_append (list, info));
+ gp_port_info_list_append (list, info); /* do not check here */
usb_init ();
usb_find_busses ();
diff --git a/libgphoto2_port/vusb/vusb.c b/libgphoto2_port/vusb/vusb.c
index a2c105071..9d3105b1f 100644
--- a/libgphoto2_port/vusb/vusb.c
+++ b/libgphoto2_port/vusb/vusb.c
@@ -84,7 +84,7 @@ gp_port_library_list (GPPortInfoList *list)
gp_port_info_set_type (info, GP_PORT_USB);
gp_port_info_set_name (info, "");
gp_port_info_set_path (info, "^usb:");
- CHECK (gp_port_info_list_append (list, info));
+ gp_port_info_list_append (list, info); /* do not check, might be -1 */
gp_port_info_new (&info);
gp_port_info_set_type (info, GP_PORT_USB);