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!
This commit is contained in:
Omar Polo 2021-10-07 17:19:45 +00:00
parent 492a274fd7
commit 807869c14e
1 changed files with 2 additions and 1 deletions

3
gmid.c
View File

@ -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));
}
}
}