mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-16 10:20:30 +00:00
Yet a major/dev_t confusion
Spotted by Bruce.
This commit is contained in:
parent
1a4dd80a43
commit
9cead0b272
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=46780
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* from: @(#)swapgeneric.c 5.5 (Berkeley) 5/9/91
|
||||
* $Id: swapgeneric.c,v 1.28 1999/04/15 15:35:32 bde Exp $
|
||||
* $Id: swapgeneric.c,v 1.29 1999/05/07 10:10:25 phk Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -55,6 +55,7 @@ setconf()
|
||||
char name[128];
|
||||
char *cp;
|
||||
int bd, unit;
|
||||
dev_t dev;
|
||||
|
||||
retry:
|
||||
printf("root device? ");
|
||||
@ -72,10 +73,12 @@ setconf()
|
||||
}
|
||||
unit = *cp - '0';
|
||||
*cp++ = '\0';
|
||||
for (bd = 0; bd < nblkdev; bd++)
|
||||
if (bdevsw(bd) != NULL &&
|
||||
strcmp(bdevsw(bd)->d_name, name) == 0)
|
||||
for (bd = 0; bd < nblkdev; bd++) {
|
||||
dev = makedev(bd, 0);
|
||||
if (bdevsw(dev) != NULL &&
|
||||
strcmp(bdevsw(dev)->d_name, name) == 0)
|
||||
goto gotit;
|
||||
}
|
||||
goto bad;
|
||||
gotit:
|
||||
while (*cp >= '0' && *cp <= '9')
|
||||
|
Loading…
Reference in New Issue
Block a user