summaryrefslogtreecommitdiffstats
path: root/rss.c
diff options
context:
space:
mode:
Diffstat (limited to 'rss.c')
-rw-r--r--rss.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/rss.c b/rss.c
index e0f22fe..b175441 100644
--- a/rss.c
+++ b/rss.c
@@ -1,4 +1,7 @@
+#include <errno.h>
+#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include "config.h"
#include "sm.h"
@@ -61,7 +64,12 @@ rssexport(Document **doc, int ndoc)
qsort(doc, ndoc, sizeof(*doc), (int (*)(const void *, const void *))creatcompar);
- outf = xfopen(krssexport, "w");
+ if (!mkparentdirs(krssexport))
+ return;
+ if ((outf = fopen(krssexport, "w")) == NULL) {
+ fprintf(stderr, "%s: %s\n", krssexport, strerror(errno));
+ return;
+ }
for (j = 0; j < LEN(header); j++)
xfputs(header[j], outf);
for (i = 0; i < ndoc; i++) {