1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-05 09:14:03 +00:00

Found more places where 'r' was being prepended to the device name.

This commit is contained in:
David E. O'Brien 2000-04-20 08:00:29 +00:00
parent 7eaef3ae4b
commit 43c6c959b9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=59429
2 changed files with 16 additions and 8 deletions

View File

@ -133,13 +133,14 @@ enum {
UNSPEC, EDIT, NOWRITE, READ, RESTORE, WRITE, WRITEABLE, WRITEBOOT
} op = UNSPEC;
int mflag;
int rflag;
#ifdef DEBUG
int debug;
#define OPTIONS "BNRWb:ders:w"
#define OPTIONS "BNRWb:demrs:w"
#else
#define OPTIONS "BNRWb:ers:w"
#define OPTIONS "BNRWb:emrs:w"
#endif
int
@ -187,6 +188,9 @@ main(argc, argv)
usage();
op = EDIT;
break;
case 'm':
++mflag;
break;
case 'r':
++rflag;
break;
@ -232,7 +236,7 @@ main(argc, argv)
specname = dkname;
f = open(specname, op == READ ? O_RDONLY : O_RDWR);
if (f < 0 && errno == ENOENT && dkname[0] != '/') {
(void)sprintf(specname, "%sr%s", _PATH_DEV, dkname);
(void)sprintf(specname, "%s%s", _PATH_DEV, dkname);
np = namebuf + strlen(specname) + 1;
f = open(specname, op == READ ? O_RDONLY : O_RDWR);
}
@ -1342,7 +1346,7 @@ getvirginlabel(void)
warnx("\"auto\" requires the usage of a canonical disk name");
return (NULL);
}
(void)snprintf(namebuf, BBSIZE, "%sr%s", _PATH_DEV, dkname);
(void)snprintf(namebuf, BBSIZE, "%s%s", _PATH_DEV, dkname);
if ((f = open(namebuf, O_RDONLY)) == -1) {
warn("cannot open %s", namebuf);
return (NULL);

View File

@ -133,13 +133,14 @@ enum {
UNSPEC, EDIT, NOWRITE, READ, RESTORE, WRITE, WRITEABLE, WRITEBOOT
} op = UNSPEC;
int mflag;
int rflag;
#ifdef DEBUG
int debug;
#define OPTIONS "BNRWb:ders:w"
#define OPTIONS "BNRWb:demrs:w"
#else
#define OPTIONS "BNRWb:ers:w"
#define OPTIONS "BNRWb:emrs:w"
#endif
int
@ -187,6 +188,9 @@ main(argc, argv)
usage();
op = EDIT;
break;
case 'm':
++mflag;
break;
case 'r':
++rflag;
break;
@ -232,7 +236,7 @@ main(argc, argv)
specname = dkname;
f = open(specname, op == READ ? O_RDONLY : O_RDWR);
if (f < 0 && errno == ENOENT && dkname[0] != '/') {
(void)sprintf(specname, "%sr%s", _PATH_DEV, dkname);
(void)sprintf(specname, "%s%s", _PATH_DEV, dkname);
np = namebuf + strlen(specname) + 1;
f = open(specname, op == READ ? O_RDONLY : O_RDWR);
}
@ -1342,7 +1346,7 @@ getvirginlabel(void)
warnx("\"auto\" requires the usage of a canonical disk name");
return (NULL);
}
(void)snprintf(namebuf, BBSIZE, "%sr%s", _PATH_DEV, dkname);
(void)snprintf(namebuf, BBSIZE, "%s%s", _PATH_DEV, dkname);
if ((f = open(namebuf, O_RDONLY)) == -1) {
warn("cannot open %s", namebuf);
return (NULL);