Add better error description in case a file could not be opened. - geomyidae - A small C-based gopherd. HTML git clone git://bitreich.org/geomyidae/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/geomyidae/ DIR Log DIR Files DIR Refs DIR Tags DIR README DIR LICENSE --- DIR commit 9a2203506973a803e74ffa80a27f2bf1919b68cc DIR parent 7b14b6e74778cf0ddb328cf3e049a302be614b36 HTML Author: Christoph Lohmann <20h@r-36.net> Date: Wed, 4 Jan 2017 22:09:39 +0100 Add better error description in case a file could not be opened. Diffstat: M main.c | 5 +++++ 1 file changed, 5 insertions(+), 0 deletions(-) --- DIR diff --git a/main.c b/main.c @@ -188,6 +188,11 @@ handlerequest(int sock, char *base, char *ohost, char *port, char *clienth, } } else { fd = open(path, O_RDONLY); + if(fd < 0) { + if(loglvl & ERRORS) + logentry(clienth, clientp, recvc, strerror(errno)); + return; + } } if(fd >= 0) {