summaryrefslogtreecommitdiff
path: root/extras/volume_id/udev_volume_id.c
diff options
context:
space:
mode:
authorkay.sievers@vrfy.org <kay.sievers@vrfy.org>2004-10-18 22:57:41 -0700
committerGreg KH <gregkh@suse.de>2005-04-26 22:06:44 -0700
commitff694eca172deb298e806246f6e88bc66235534a (patch)
tree475aa7aee75d2c5d01cb4b8da7e6d471b459b496 /extras/volume_id/udev_volume_id.c
parent3b2382de5192057d4c3ac25ddce9c70348d756f9 (diff)
[PATCH] fix debug in volume id / fix clashing global var name
Here we get the logging for udev_volume_id working if it is compiled with DEBUG=true. Also fixed is a name clash with a global variable.
Diffstat (limited to 'extras/volume_id/udev_volume_id.c')
-rw-r--r--extras/volume_id/udev_volume_id.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/extras/volume_id/udev_volume_id.c b/extras/volume_id/udev_volume_id.c
index 6b62db0775..5d1ccf6a89 100644
--- a/extras/volume_id/udev_volume_id.c
+++ b/extras/volume_id/udev_volume_id.c
@@ -104,7 +104,7 @@ int main(int argc, char *argv[])
" -d disk label from main device\n"
"\n";
static const char short_options[] = "htlud";
- char sysfs_path[SYSFS_PATH_MAX];
+ char sysfs_mnt_path[SYSFS_PATH_MAX];
char dev_path[SYSFS_PATH_MAX];
struct sysfs_class_device *class_dev = NULL;
struct sysfs_class_device *class_dev_parent = NULL;
@@ -118,6 +118,8 @@ int main(int argc, char *argv[])
unsigned long long size;
int rc = 1;
+ logging_init("udev_volume_id");
+
while (1) {
int option;
@@ -152,12 +154,12 @@ int main(int argc, char *argv[])
goto exit;
}
- if (sysfs_get_mnt_path(sysfs_path, SYSFS_PATH_MAX) != 0) {
+ if (sysfs_get_mnt_path(sysfs_mnt_path, SYSFS_PATH_MAX) != 0) {
printf("error getting sysfs mount path\n");
goto exit;
}
- strfieldcpy(dev_path, sysfs_path);
+ strfieldcpy(dev_path, sysfs_mnt_path);
strfieldcat(dev_path, devpath);
class_dev = sysfs_open_class_device_path(dev_path);
@@ -261,5 +263,7 @@ exit:
if (vid != NULL)
volume_id_close(vid);
+ logging_close();
+
exit(rc);
}