diff options
author | NeilBrown <neilb@suse.de> | 2008-11-04 10:35:43 +1100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2008-11-04 10:35:43 +1100 |
commit | 40ebbb9cfee33d550ab683846a9d38d2995a7059 (patch) | |
tree | 93a56d1984a785c79f8718b5c885eda9684184ec /super-intel.c | |
parent | c30e53693e238d3b14113f5061c103b34f7a93c4 (diff) |
util: make env checking more generic
Change the "env_check_mdmon" function to be more generic, accepting
and environment variable name, as soon we will have a new use for it.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'super-intel.c')
-rw-r--r-- | super-intel.c | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/super-intel.c b/super-intel.c index c300503c..f5ce06bd 100644 --- a/super-intel.c +++ b/super-intel.c @@ -213,17 +213,6 @@ struct imsm_update_add_disk { enum imsm_update_type type; }; -static int imsm_env_devname_as_serial(void) -{ - char *val = getenv("IMSM_DEVNAME_AS_SERIAL"); - - if (val && atoi(val) == 1) - return 1; - - return 0; -} - - static struct supertype *match_metadata_desc_imsm(char *arg) { struct supertype *st; @@ -1017,7 +1006,7 @@ static int imsm_read_serial(int fd, char *devname, rv = scsi_get_serial(fd, scsi_serial, sizeof(scsi_serial)); - if (rv && imsm_env_devname_as_serial()) { + if (rv && check_env("IMSM_DEVNAME_AS_SERIAL")) { memset(serial, 0, MAX_RAID_SERIAL_LEN); fd2devname(fd, (char *) serial); return 0; |