chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
scsi_id: switch temporary node creation to /dev
[elogind.git]
/
extras
/
scsi_id
/
scsi_id.c
diff --git
a/extras/scsi_id/scsi_id.c
b/extras/scsi_id/scsi_id.c
index a46d1b377da97dfd08075a76b37f6ebdc4da0cac..39391f6e2e0102a9fb89571987dadbd9607fc669 100644
(file)
--- a/
extras/scsi_id/scsi_id.c
+++ b/
extras/scsi_id/scsi_id.c
@@
-44,8
+44,8
@@
/*
* temporary names for mknod.
*/
/*
* temporary names for mknod.
*/
-#define TMP_DIR "/
tmp
"
-#define TMP_PREFIX "scsi"
+#define TMP_DIR "/
dev
"
+#define TMP_PREFIX "
tmp-
scsi"
/*
* XXX Note the 'e' (send output to stderr in all cases), and 'c' (callout)
/*
* XXX Note the 'e' (send output to stderr in all cases), and 'c' (callout)
@@
-67,7
+67,7
@@
static int dev_specified;
static int sys_specified;
static char config_file[MAX_NAME_LEN] = SCSI_ID_CONFIG_FILE;
static int display_bus_id;
static int sys_specified;
static char config_file[MAX_NAME_LEN] = SCSI_ID_CONFIG_FILE;
static int display_bus_id;
-static
int
default_page_code;
+static
enum page_code
default_page_code;
static int use_stderr;
static int debug;
static int hotplug_mode;
static int use_stderr;
static int debug;
static int hotplug_mode;
@@
-107,7
+107,7
@@
static void set_str(char *to, const char *from, size_t count)
/* strip trailing whitespace */
len = strnlen(from, count);
/* strip trailing whitespace */
len = strnlen(from, count);
- while (isspace(from[len-1]))
+ while (
len &&
isspace(from[len-1]))
len--;
/* strip leading whitespace */
len--;
/* strip leading whitespace */
@@
-519,9
+519,11
@@
static int set_options(int argc, char **argv, const char *short_opts,
case 'p':
if (strcmp(optarg, "0x80") == 0) {
case 'p':
if (strcmp(optarg, "0x80") == 0) {
- default_page_code =
0x
80;
+ default_page_code =
PAGE_
80;
} else if (strcmp(optarg, "0x83") == 0) {
} else if (strcmp(optarg, "0x83") == 0) {
- default_page_code = 0x83;
+ default_page_code = PAGE_83;
+ } else if (strcmp(optarg, "pre-spc3-83") == 0) {
+ default_page_code = PAGE_83_PRE_SPC3;
} else {
log_message(LOG_WARNING,
"Unknown page code '%s'\n", optarg);
} else {
log_message(LOG_WARNING,
"Unknown page code '%s'\n", optarg);
@@
-640,9
+642,11
@@
static int per_dev_options(struct sysfs_device *scsi_dev, int *good_bad,
case 'p':
if (strcmp(optarg, "0x80") == 0) {
case 'p':
if (strcmp(optarg, "0x80") == 0) {
- *page_code =
0x
80;
+ *page_code =
PAGE_
80;
} else if (strcmp(optarg, "0x83") == 0) {
} else if (strcmp(optarg, "0x83") == 0) {
- *page_code = 0x83;
+ *page_code = PAGE_83;
+ } else if (strcmp(optarg, "pre-spc3-83") == 0) {
+ *page_code = PAGE_83_PRE_SPC3;
} else {
log_message(LOG_WARNING,
"Unknown page code '%s'\n", optarg);
} else {
log_message(LOG_WARNING,
"Unknown page code '%s'\n", optarg);