hermes

HTTP GET/HEAD-only web server for static content.
git clone git://git.francescosaccone.com/hermes
Log | Files | Refs | README | LICENSE

commit 59f7c0418994c579e268ef2f65e4c4d9e462ee8f
parent 0e0c12bde0347c2d1f20eeadd0d7ec3891264a51
Author: Francesco Saccone <francesco@francescosaccone.com>
Date:   Mon, 31 Mar 2025 16:14:09 +0200

fix: use 'access' function for file_exists

Signed-off-by: Francesco Saccone <francesco@francescosaccone.com>

Diffstat:
Mfile.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/file.c b/file.c @@ -1,7 +1,8 @@ #include "file.h" +#include <unistd.h> + int file_exists(const char *path) { - struct stat buffer; - return (stat(path, &buffer) == 0); + return (access(path, R_OK) == 0); }