mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-03 19:08:58 +00:00
Fix the reporting of a raw device node.
Change a warnx to an errx since we should only attempt to use this utility on a character device. Approved by: green
This commit is contained in:
parent
13f5bcc90d
commit
7333848d98
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=63892
@ -336,7 +336,7 @@ main(int argc, char *argv[])
|
||||
usage();
|
||||
fname = *argv++;
|
||||
if (!strchr(fname, '/')) {
|
||||
snprintf(buf, sizeof(buf), "%sr%s", _PATH_DEV, fname);
|
||||
snprintf(buf, sizeof(buf), "%s%s", _PATH_DEV, fname);
|
||||
if (stat(buf, &sb))
|
||||
snprintf(buf, sizeof(buf), "%s%s", _PATH_DEV, fname);
|
||||
if (!(fname = strdup(buf)))
|
||||
@ -349,7 +349,7 @@ main(int argc, char *argv[])
|
||||
if (!opt_N)
|
||||
check_mounted(fname, sb.st_mode);
|
||||
if (!S_ISCHR(sb.st_mode))
|
||||
warnx("warning: %s is not a character device", fname);
|
||||
errx(1, "%s is not a character device", fname);
|
||||
memset(&bpb, 0, sizeof(bpb));
|
||||
if (opt_f) {
|
||||
getstdfmt(opt_f, &bpb);
|
||||
|
Loading…
Reference in New Issue
Block a user