From 2416e28bbc74959fcd5b9371c19152ec3d0c3d78 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Tue, 11 Nov 2014 19:11:30 +0100 Subject: remove fileexists function --- sfeed_frames.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/sfeed_frames.c b/sfeed_frames.c index 57ff3d7..28975ed 100644 --- a/sfeed_frames.c +++ b/sfeed_frames.c @@ -93,11 +93,6 @@ makepathname(const char *path, char *buffer, size_t bufsiz) { return i; } -static int -fileexists(const char *path) { - return (!access(path, F_OK)); -} - int main(int argc, char **argv) { struct feed *f, *fcur = NULL; @@ -205,7 +200,9 @@ main(int argc, char **argv) { die("snprintf() format error"); if(snprintf(relfilepath, sizeof(relfilepath), "%s/%s.html", reldirpath, name) <= 0) die("snprintf() format error"); - if(!fileexists(filepath) && (fpcontent = fopen(filepath, "w+b"))) { + + /* file doesn't exist yet and has write access */ + if(access(filepath, F_OK) != 0 && (fpcontent = fopen(filepath, "w+b"))) { fputs("" "\n" "
" -- cgit v1.2.3