From 0abc02edc2f3781da921c01b9d740caacfe14b12 Mon Sep 17 00:00:00 2001 From: grog Date: Sun, 30 Dec 2007 22:02:50 +0000 Subject: 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. --- usr.bin/calendar/io.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'usr.bin/calendar') 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) -- cgit v1.1