From 807869c14ee57aaa6035e6cba0df5d1369ced9ba Mon Sep 17 00:00:00 2001 From: Omar Polo Date: Thu, 7 Oct 2021 17:19:45 +0000 Subject: [PATCH] print the error too if we can't open a directory It's not intuitive to print open ... for domain xyz it doesn't convey that the open failed. now it appends the error string, at least the user can understand that something went wrong. reported by cage on irc, thanks! --- gmid.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gmid.c b/gmid.c index c8d1b57..f0ffa3e 100644 --- a/gmid.c +++ b/gmid.c @@ -133,7 +133,8 @@ load_vhosts(void) if (l->dir == NULL) continue; if ((l->dirfd = open(l->dir, O_RDONLY | O_DIRECTORY)) == -1) - fatal("open %s for domain %s", l->dir, h->domain); + fatal("open %s for domain %s: %s", l->dir, h->domain, + strerror(errno)); } } }