diff --git a/src/utils/os_unix.c b/src/utils/os_unix.c index 0118d9816..65c6fa412 100644 --- a/src/utils/os_unix.c +++ b/src/utils/os_unix.c @@ -435,11 +435,7 @@ char * os_readfile(const char *name, size_t *len) int os_file_exists(const char *fname) { - FILE *f = fopen(fname, "rb"); - if (f == NULL) - return 0; - fclose(f); - return 1; + return access(fname, F_OK) == 0; }