summaryrefslogtreecommitdiffstats
path: root/usr.bin/wc/wc.c
diff options
context:
space:
mode:
authorwosch <wosch@FreeBSD.org>1996-04-10 22:21:01 +0000
committerwosch <wosch@FreeBSD.org>1996-04-10 22:21:01 +0000
commit3fae17b82ded3d52ac678a6c692f12ec8416bf13 (patch)
treec1bccc60fab7353150cadcb1f7cec2d7c9cdb399 /usr.bin/wc/wc.c
parentca605615956b18af1d70d76e1292e4e97b20ad0b (diff)
downloadFreeBSD-src-3fae17b82ded3d52ac678a6c692f12ec8416bf13.zip
FreeBSD-src-3fae17b82ded3d52ac678a6c692f12ec8416bf13.tar.gz
Do not exit if a file is not readable. This is a short hack
until someone rewrite wc(1).
Diffstat (limited to 'usr.bin/wc/wc.c')
-rw-r--r--usr.bin/wc/wc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/wc/wc.c b/usr.bin/wc/wc.c
index 1f1c9b3..abc258b 100644
--- a/usr.bin/wc/wc.c
+++ b/usr.bin/wc/wc.c
@@ -129,8 +129,10 @@ cnt(file)
fd = STDIN_FILENO;
linect = wordct = charct = 0;
if (file) {
- if ((fd = open(file, O_RDONLY, 0)) < 0)
- err("%s: %s", file, strerror(errno));
+ if ((fd = open(file, O_RDONLY, 0)) < 0) {
+ warn("%s", file);
+ return;
+ }
if (doword)
goto word;
/*
OpenPOWER on IntegriCloud