INSTALL_DATA = ${INSTALL} -m 644
INSTALL_SCRIPT = ${INSTALL_PROGRAM}
-override CFLAGS+=-Wall -fno-builtin -Wchar-subscripts -Wmissing-declarations \
- -Wnested-externs -Wpointer-arith -Wcast-align \
- -Wsign-compare
+override CFLAGS+=-Wall -fno-builtin -Wchar-subscripts \
+ -Wpointer-arith -Wcast-align -Wsign-compare
override CFLAGS+=-D_FILE_OFFSET_BITS=64
" -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;
unsigned long long size;
int rc = 1;
+ logging_init("udev_volume_id");
+
while (1) {
int option;
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);
if (vid != NULL)
volume_id_close(vid);
+ logging_close();
+
exit(rc);
}
const char *devpath = "";
const char *action;
const char *subsystem;
- char sysfs_path[SYSFS_PATH_MAX];
+ char sysfs_mnt_path[SYSFS_PATH_MAX];
char filename[SYSFS_PATH_MAX];
struct sysfs_class_device *class_dev;
struct sysfs_device *devices_dev;
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) {
dbg("error: no sysfs path");
rc = 2;
goto exit;
}
if ((strncmp(devpath, "/block/", 7) == 0) || (strncmp(devpath, "/class/", 7) == 0)) {
- snprintf(filename, SYSFS_PATH_MAX-1, "%s%s", sysfs_path, devpath);
+ snprintf(filename, SYSFS_PATH_MAX-1, "%s%s", sysfs_mnt_path, devpath);
filename[SYSFS_PATH_MAX-1] = '\0';
/* open the class device we are called for */
sysfs_close_class_device(class_dev);
} else if ((strncmp(devpath, "/devices/", 9) == 0)) {
- snprintf(filename, SYSFS_PATH_MAX-1, "%s%s", sysfs_path, devpath);
+ snprintf(filename, SYSFS_PATH_MAX-1, "%s%s", sysfs_mnt_path, devpath);
filename[SYSFS_PATH_MAX-1] = '\0';
/* open the path we are called for */