summaryrefslogtreecommitdiffstats
path: root/lib/libc
diff options
context:
space:
mode:
authorcharnier <charnier@FreeBSD.org>2000-03-26 15:18:12 +0000
committercharnier <charnier@FreeBSD.org>2000-03-26 15:18:12 +0000
commitabcb2d08a5004b7817df4d1fb96142ba3b92f6da (patch)
treeb2d5cf1e44c0d60e33b407d994ab2cf2124822a4 /lib/libc
parentdf60edbd20de41d618c2a5a2ee96d7622fc7c89f (diff)
downloadFreeBSD-src-abcb2d08a5004b7817df4d1fb96142ba3b92f6da.zip
FreeBSD-src-abcb2d08a5004b7817df4d1fb96142ba3b92f6da.tar.gz
Spelling, fprintf -> err, remove unneeded variable declaration
Diffstat (limited to 'lib/libc')
-rw-r--r--lib/libc/stdlib/getopt.311
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/libc/stdlib/getopt.3 b/lib/libc/stdlib/getopt.3
index 7017c4f..43758e3 100644
--- a/lib/libc/stdlib/getopt.3
+++ b/lib/libc/stdlib/getopt.3
@@ -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:
OpenPOWER on IntegriCloud