Grow_Add_device(): dev_open() return a negative fd on error

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
Jes Sorensen 2011-11-01 16:09:17 +01:00 committed by NeilBrown
parent 446894ea8d
commit 68fe8c6ed0
1 changed files with 1 additions and 1 deletions

2
Grow.c
View File

@ -174,7 +174,7 @@ int Grow_Add_device(char *devname, int fd, char *newdev)
return 1;
}
fd2 = dev_open(dv, O_RDWR);
if (!fd2) {
if (fd2 < 0) {
fprintf(stderr, Name ": cannot open device file %s\n", dv);
close(nfd);
free(st);