summaryrefslogtreecommitdiff
path: root/libgphoto2_port/usbscsi
diff options
context:
space:
mode:
authorMarcus Meissner <marcus@jet.franken.de>2010-03-29 09:39:26 +0000
committerMarcus Meissner <marcus@jet.franken.de>2010-03-29 09:39:26 +0000
commit7090b6fbbbd558a6778fda4efb79c36ac0bc023a (patch)
tree79d98b9491721790c45ce2921216dde079a3ea70 /libgphoto2_port/usbscsi
parent4164f66dc093ed5a6c6223577ace90b2ab123705 (diff)
downloadlibgphoto2-7090b6fbbbd558a6778fda4efb79c36ac0bc023a.tar.gz
fixed build with TRUNK
fixed memleak git-svn-id: https://svn.code.sf.net/p/gphoto/code/trunk/libgphoto2@12857 67ed7778-7388-44ab-90cf-0a291f65f57c
Diffstat (limited to 'libgphoto2_port/usbscsi')
-rw-r--r--libgphoto2_port/usbscsi/Makefile-files10
-rw-r--r--libgphoto2_port/usbscsi/linux.c12
2 files changed, 12 insertions, 10 deletions
diff --git a/libgphoto2_port/usbscsi/Makefile-files b/libgphoto2_port/usbscsi/Makefile-files
index b8469ba67..edb67c37c 100644
--- a/libgphoto2_port/usbscsi/Makefile-files
+++ b/libgphoto2_port/usbscsi/Makefile-files
@@ -2,13 +2,13 @@
EXTRA_LTLIBRARIES += usbscsi.la
-usbdiskdirect_la_LDFLAGS = -module -no-undefined -avoid-version \
+usbscsi_la_LDFLAGS = -module -no-undefined -avoid-version \
-export-dynamic \
-export-symbols $(top_srcdir)/iolib.sym
-usbdiskdirect_la_CPPFLAGS = $(AM_CPPFLAGS) $(INTL_CFLAGS) $(CPPFLAGS)
-usbdiskdirect_la_DEPENDENCIES = $(top_srcdir)/iolib.sym
-usbdiskdirect_la_LIBADD = \
+usbscsi_la_CPPFLAGS = $(AM_CPPFLAGS) $(INTL_CFLAGS) $(CPPFLAGS)
+usbscsi_la_DEPENDENCIES = $(top_srcdir)/iolib.sym
+usbscsi_la_LIBADD = \
$(top_builddir)/libgphoto2_port/libgphoto2_port.la \
$(SERIAL_LIBS) \
$(INTLLIBS)
-usbdiskdirect_la_SOURCES = usbscsi/linux.c
+usbscsi_la_SOURCES = usbscsi/linux.c
diff --git a/libgphoto2_port/usbscsi/linux.c b/libgphoto2_port/usbscsi/linux.c
index aad18c20f..6bf8df62c 100644
--- a/libgphoto2_port/usbscsi/linux.c
+++ b/libgphoto2_port/usbscsi/linux.c
@@ -202,19 +202,21 @@ gp_port_library_list (GPPortInfoList *list)
return GP_OK;
while ((dirent = readdir (dir))) {
+ char path[4096];
if (gp_port_usbscsi_get_usb_id (dirent->d_name,
&vendor_id, &product_id) != GP_OK)
continue; /* Not a usb device */
- info.type = GP_PORT_USB_SCSI;
- snprintf (info.path, sizeof (info.path),
+ gp_port_info_new (&info);
+ gp_port_info_set_type (info, GP_PORT_USB_SCSI);
+ snprintf (path, sizeof (path),
"usbscsi:/dev/%s",
dirent->d_name);
- snprintf (info.name, sizeof (info.name),
- _("USB Mass Storage raw SCSI"));
+ gp_port_info_set_path (info, path);
+ gp_port_info_set_name (info, _("USB Mass Storage raw SCSI"));
CHECK (gp_port_info_list_append (list, info))
}
-
+ closedir (dir);
return GP_OK;
}