diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2014-11-11 19:11:30 +0100 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2014-11-11 19:11:30 +0100 |
commit | 2416e28bbc74959fcd5b9371c19152ec3d0c3d78 (patch) | |
tree | ed6f11b1f192902d23306bd099590c56c4a29983 | |
parent | 5835c87f41f97a9f8f0c0ccbaea1615223e3b014 (diff) |
remove fileexists function
-rw-r--r-- | sfeed_frames.c | 9 |
1 files 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("<html><head><link rel=\"stylesheet\" type=\"text/css\" href=\"../../style.css\" />" "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /></head>\n" "<body class=\"frame\"><div class=\"content\">" |