From 247adb12e5aa4cac68dfba271174eef264a14ed3 Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Sun, 8 Oct 2006 23:16:08 +0000 Subject: [PATCH] Bugfix --- src/device.c | 2 +- src/volume.c | 17 ++++++----------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/src/device.c b/src/device.c index 1dd03bd..b6fa18e 100644 --- a/src/device.c +++ b/src/device.c @@ -32,7 +32,7 @@ static LibHalDrive *pusb_device_get_storage(t_pusb_options *opts, LibHalContext int maxloop = 0; LibHalDrive *drive = NULL; - log_info("Waiting for storage device probing...\n"); + log_info("Probing storage device (this could take a while)...\n"); while (!(phy_udi = pusb_hal_find_item(ctx, "info.parent", udi, "info.bus", "usb", diff --git a/src/volume.c b/src/volume.c index b56aa3f..a927307 100644 --- a/src/volume.c +++ b/src/volume.c @@ -33,23 +33,17 @@ static int pusb_volume_mount(t_pusb_options *opts, LibHalVolume **volume, char command[1024]; char tempname[32]; const char *devname; - const char *fs; snprintf(tempname, sizeof(tempname), "pam_usb%d", getpid()); - if (!(fs = libhal_volume_get_fstype(*volume))) - { - log_error("Unable to retrieve filesystem type\n"); - return (0); - } if (!(devname = libhal_volume_get_device_file(*volume))) { log_error("Unable to retrieve device filename\n"); return (0); } - log_debug("Attempting to mount device %s with label %s (fs: %s)\n", - devname, tempname, fs); - snprintf(command, sizeof(command), "pmount -s -t %s %s %s", - fs, devname, tempname); + log_debug("Attempting to mount device %s with label %s\n", + devname, tempname); + snprintf(command, sizeof(command), "pmount -s %s %s", + devname, tempname); log_debug("Executing \"%s\"\n", command); if (system(command) != 0) { @@ -72,7 +66,7 @@ static int pusb_volume_mount(t_pusb_options *opts, LibHalVolume **volume, free((char *)udi); } log_debug("Mount succeeded.\n"); - return (libhal_volume_is_mounted(*volume)); + return (1); } static int __pusb_volume_find(t_pusb_options *opts, LibHalContext *ctx, @@ -154,6 +148,7 @@ void pusb_volume_destroy(LibHalVolume *volume) log_debug("Attempting to umount %s\n", mntpoint); snprintf(command, sizeof(command), "pumount %s", mntpoint); + log_debug("Executing \"%s\"\n", command); if (!system(command)) log_debug("Umount succeeded.\n"); else