When opening a disk for non-filesystem i/o, make sure we only return
an error condition when an error occurs. Bug noticed by Terry Lambert <terry@lambert.org>.
This commit is contained in:
parent
2bc8c4e5c2
commit
eae3f0bb96
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: inst.c,v 1.2 1996/06/26 18:11:24 thorpej Exp $ */
|
/* $NetBSD: inst.c,v 1.3 1996/09/11 18:05:02 thorpej Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1995 Jason R. Thorpe.
|
* Copyright (c) 1995 Jason R. Thorpe.
|
||||||
@ -108,7 +108,7 @@ main()
|
|||||||
|
|
||||||
printf("\n>> NetBSD MINIROOT INSTALLATION HP9000/%s CPU\n",
|
printf("\n>> NetBSD MINIROOT INSTALLATION HP9000/%s CPU\n",
|
||||||
getmachineid());
|
getmachineid());
|
||||||
printf(">> $NetBSD: inst.c,v 1.2 1996/06/26 18:11:24 thorpej Exp $\n");
|
printf(">> $NetBSD: inst.c,v 1.3 1996/09/11 18:05:02 thorpej Exp $\n");
|
||||||
gethelp();
|
gethelp();
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
@ -429,10 +429,12 @@ opendisk(question, diskname, len, partition, fdp)
|
|||||||
/*
|
/*
|
||||||
* We always open for writing.
|
* We always open for writing.
|
||||||
*/
|
*/
|
||||||
if ((*fdp = open(fulldiskname, 1)) < 0)
|
if ((*fdp = open(fulldiskname, 1)) < 0) {
|
||||||
printf("cannot open %s\n", diskname);
|
printf("cannot open %s\n", diskname);
|
||||||
|
return (1);
|
||||||
|
}
|
||||||
|
|
||||||
return (errno);
|
return (0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user