summaryrefslogtreecommitdiff
path: root/extras/scsi_id/scsi_id.c
diff options
context:
space:
mode:
authorpatmans@us.ibm.com <patmans@us.ibm.com>2004-06-26 01:18:17 -0700
committerGreg KH <gregkh@suse.de>2005-04-26 21:36:21 -0700
commit062db23d5eb303ef49d2ff805381229932f44246 (patch)
treefa4bec0bad640e27afce8f676c0647476fd31348 /extras/scsi_id/scsi_id.c
parentc59a72105d0ff8a47b31f1829dd3c166ebd859d0 (diff)
[PATCH] update udev scsi_id to scsi_id 0.5
This patch syncs the scsi_id in the udev tree to version 0.5.
Diffstat (limited to 'extras/scsi_id/scsi_id.c')
-rw-r--r--extras/scsi_id/scsi_id.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/extras/scsi_id/scsi_id.c b/extras/scsi_id/scsi_id.c
index 1cd6981e5e..e893987868 100644
--- a/extras/scsi_id/scsi_id.c
+++ b/extras/scsi_id/scsi_id.c
@@ -111,7 +111,7 @@ int sysfs_get_attr(const char *devpath, const char *attr, char *value,
return sysfs_read_attribute_value(attr_path, value, SYSFS_NAME_LEN);
}
-static int get_major_minor(const char *devpath, int *major, int *minor)
+static int get_major_minor(const char *devpath, int *maj, int *min)
{
char dev_value[MAX_ATTR_LEN];
@@ -129,7 +129,7 @@ static int get_major_minor(const char *devpath, int *major, int *minor)
}
dprintf("dev value %s", dev_value); /* dev_value has a trailing \n */
- if (sscanf(dev_value, "%u:%u", major, minor) != 2) {
+ if (sscanf(dev_value, "%u:%u", maj, min) != 2) {
log_message(LOG_WARNING, "%s: invalid dev major/minor\n",
devpath);
return -1;
@@ -140,18 +140,18 @@ static int get_major_minor(const char *devpath, int *major, int *minor)
static int create_tmp_dev(const char *devpath, char *tmpdev, int dev_type)
{
- int major, minor;
+ int maj, min;
dprintf("(%s)\n", devpath);
- if (get_major_minor(devpath, &major, &minor))
+ if (get_major_minor(devpath, &maj, &min))
return -1;
snprintf(tmpdev, MAX_NAME_LEN, "%s/%s-maj%d-min%d-%u",
- TMP_DIR, TMP_PREFIX, major, minor, getpid());
+ TMP_DIR, TMP_PREFIX, maj, min, getpid());
dprintf("tmpdev '%s'\n", tmpdev);
- if (mknod(tmpdev, 0600 | dev_type, makedev(major, minor))) {
+ if (mknod(tmpdev, 0600 | dev_type, makedev(maj, min))) {
log_message(LOG_WARNING, "mknod failed: %s\n", strerror(errno));
return -1;
}
@@ -759,10 +759,6 @@ int main(int argc, char **argv)
strncpy(target_path, sysfs_mnt_path, MAX_NAME_LEN);
strncat(target_path, devpath, MAX_NAME_LEN);
- } else {
- if (set_options(argc, argv, short_options, target_path,
- maj_min_dev) < 0)
- exit(1);
}
/*
@@ -779,6 +775,11 @@ int main(int argc, char **argv)
exit(1);
free(newargv);
}
+ if (!hotplug_mode) {
+ if (set_options(argc, argv, short_options, target_path,
+ maj_min_dev) < 0)
+ exit(1);
+ }
if (!sys_specified) {
log_message(LOG_WARNING, "-s must be specified\n");