summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sfeed_frames.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/sfeed_frames.c b/sfeed_frames.c
index 6edf3c9..06d2c0d 100644
--- a/sfeed_frames.c
+++ b/sfeed_frames.c
@@ -106,7 +106,6 @@ printfeed(FILE *fpitems, FILE *fpin, struct feed *f)
char dirpath[PATH_MAX], filepath[PATH_MAX];
char *fields[FieldLast], *feedname, name[128];
ssize_t linelen;
- struct stat st;
FILE *fpcontent = NULL;
unsigned int isnew;
time_t parsedtime;
@@ -123,8 +122,8 @@ printfeed(FILE *fpitems, FILE *fpin, struct feed *f)
strlcpy(dirpath, name, sizeof(dirpath));
- /* directory doesn't exist: try to create it. */
- if (stat(dirpath, &st) == -1 && mkdir(dirpath, S_IRWXU) == -1)
+ /* error creating directory and it doesn't exist. */
+ if (mkdir(dirpath, S_IRWXU | S_IRWXG | S_IRWXO) == -1 && errno != EEXIST)
err(1, "mkdir: %s", dirpath);
/* menu if not unnamed */