Spelling, fprintf -> err, remove unneeded variable declaration
This commit is contained in:
parent
c0154e9a31
commit
f25c63af03
@ -126,7 +126,7 @@ when the argument list is exhausted, or
|
||||
.Ql ?
|
||||
if a non-recognized
|
||||
option is encountered.
|
||||
The interpretation of options in the argument list may be canceled
|
||||
The interpretation of options in the argument list may be cancelled
|
||||
by the option
|
||||
.Ql --
|
||||
(double dash) which causes
|
||||
@ -172,8 +172,6 @@ This is an extension to the
|
||||
specification.
|
||||
.Sh EXAMPLE
|
||||
.Bd -literal -compact
|
||||
extern char *optarg;
|
||||
extern int optind;
|
||||
int bflag, ch, fd;
|
||||
|
||||
bflag = 0;
|
||||
@ -183,11 +181,8 @@ while ((ch = getopt(argc, argv, "bf:")) != -1)
|
||||
bflag = 1;
|
||||
break;
|
||||
case 'f':
|
||||
if ((fd = open(optarg, O_RDONLY, 0)) < 0) {
|
||||
(void)fprintf(stderr,
|
||||
"myname: %s: %s\en", optarg, strerror(errno));
|
||||
exit(1);
|
||||
}
|
||||
if ((fd = open(optarg, O_RDONLY, 0)) < 0)
|
||||
err(1, "%s", optarg);
|
||||
break;
|
||||
case '?':
|
||||
default:
|
||||
|
Loading…
x
Reference in New Issue
Block a user