diff options
author | Dan Williams <dan.j.williams@intel.com> | 2009-01-20 00:29:34 -0700 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2009-01-20 00:29:34 -0700 |
commit | be2c0e387b88c801a5b5f07d7f447a4dba97100e (patch) | |
tree | c66392bc657230458ec3bbe2f08c0d718e781074 /super-intel.c | |
parent | c1363b408f7b9f7a997c4cd706934a062bfca3bc (diff) | |
download | mdadm-be2c0e387b88c801a5b5f07d7f447a4dba97100e.tar.gz mdadm-be2c0e387b88c801a5b5f07d7f447a4dba97100e.tar.xz mdadm-be2c0e387b88c801a5b5f07d7f447a4dba97100e.zip |
imsm: fix dev_open return value handling
dev_open returns an fd
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'super-intel.c')
-rw-r--r-- | super-intel.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/super-intel.c b/super-intel.c index 94f46ca..4eaca9d 100644 --- a/super-intel.c +++ b/super-intel.c @@ -1915,7 +1915,7 @@ static int load_super_imsm_all(struct supertype *st, int fd, void **sbp, for (sd = sra->devs; sd; sd = sd->next) { sprintf(nm, "%d:%d", sd->disk.major, sd->disk.minor); dfd = dev_open(nm, keep_fd ? O_RDWR : O_RDONLY); - if (!dfd) { + if (dfd < 0) { free_imsm(super); return 2; } @@ -1945,7 +1945,7 @@ static int load_super_imsm_all(struct supertype *st, int fd, void **sbp, /* load the most up to date anchor */ sprintf(nm, "%d:%d", best->disk.major, best->disk.minor); dfd = dev_open(nm, O_RDONLY); - if (!dfd) { + if (dfd < 0) { free_imsm(super); return 1; } @@ -1960,7 +1960,7 @@ static int load_super_imsm_all(struct supertype *st, int fd, void **sbp, for (sd = sra->devs ; sd ; sd = sd->next) { sprintf(nm, "%d:%d", sd->disk.major, sd->disk.minor); dfd = dev_open(nm, keep_fd? O_RDWR : O_RDONLY); - if (!dfd) { + if (dfd < 0) { free_imsm(super); return 2; } |