summaryrefslogtreecommitdiffstats
path: root/usr.bin/calendar
diff options
context:
space:
mode:
authorgrog <grog@FreeBSD.org>2007-12-30 22:02:50 +0000
committergrog <grog@FreeBSD.org>2007-12-30 22:02:50 +0000
commit0abc02edc2f3781da921c01b9d740caacfe14b12 (patch)
tree4e44c94607c359542cef984d28aa73de57ad0693 /usr.bin/calendar
parentfac9c01c237e49ddbc0359b9f037f18b883a0e10 (diff)
downloadFreeBSD-src-0abc02edc2f3781da921c01b9d740caacfe14b12.zip
FreeBSD-src-0abc02edc2f3781da921c01b9d740caacfe14b12.tar.gz
If we can't open a calendar file, don't guess why. Check the error
return and print a useful message. Prior to this commit, access problems could give rise to messages that the file didn't exist.
Diffstat (limited to 'usr.bin/calendar')
-rw-r--r--usr.bin/calendar/io.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/calendar/io.c b/usr.bin/calendar/io.c
index 49bfa53..6eb39f9 100644
--- a/usr.bin/calendar/io.c
+++ b/usr.bin/calendar/io.c
@@ -349,7 +349,8 @@ opencal(void)
break;
}
if (!found)
- errx(1, "no calendar file: ``%s''", calendarFile);
+ errx(1, "can't open calendar file \"%s\": %s (%d)",
+ calendarFile, strerror (errno), errno);
}
}
if (pipe(pdes) < 0)
OpenPOWER on IntegriCloud