diff --git a/src/probers/part-id.c b/src/probers/part-id.c index 9cf7a20..0d9e84d 100644 --- a/src/probers/part-id.c +++ b/src/probers/part-id.c @@ -368,6 +368,8 @@ count_entries (PartitionTable *pt) return ret; } +#include + /* ---------------------------------------------------------------------------------------------------- */ int @@ -387,12 +389,16 @@ main (int argc, guint partition_number; gchar *partition_table_syspath; + openlog ("udisks-part-id", LOG_NDELAY | LOG_PID, LOG_USER); + udev = NULL; devpath = NULL; partition_table_device_file = NULL; partition_table_syspath = NULL; partition_table = NULL; + syslog (LOG_NOTICE, "a (argc=%d)", argc); + udev = udev_new (); if (udev == NULL) { @@ -403,6 +409,7 @@ main (int argc, device_file = NULL; for (n = 1; n < (guint) argc; n++) { + syslog (LOG_NOTICE, "b (argv[%d]=`%s')", n, argv[n]); if (strcmp (argv[n], "--help") == 0) { usage (argc, argv); @@ -422,13 +429,20 @@ main (int argc, goto out; } + syslog (LOG_NOTICE, "c (device_file=`%s')", device_file); + device = get_udev_device_from_device_file (udev, device_file); + syslog (LOG_NOTICE, "d (%p)", device); + partition_table_device_file = get_part_table_device_file (device, &partition_table_syspath, &partition_offset, &partition_alignment_offset, &partition_number); + + syslog (LOG_NOTICE, "e (partition_table_device_file=`%s')", partition_table_device_file); + g_printerr ("using device_file=%s syspath=%s, offset=%" G_GUINT64_FORMAT " ao=%" G_GUINT64_FORMAT " and number=%d for %s\n", partition_table_device_file, partition_table_syspath, @@ -439,6 +453,8 @@ main (int argc, fd = open (partition_table_device_file, O_RDONLY); + syslog (LOG_NOTICE, "f (fd=%d)", fd); + if (fd < 0) { g_printerr ("Error opening %s: %m\n", partition_table_device_file);