sfeed

Simple RSS and Atom feed parser
git clone https://git.sinitax.com/codemadness/sfeed
Log | Files | Refs | README | LICENSE | Upstream | sfeed.txt

commit f47a0d9ea0a5392417ae463634129354e28092d4
parent fc51ac87a52f859af5084e1abf3ab7d346f0cc20
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Fri,  4 Mar 2016 12:15:18 +0100

sfeed_frames: use S_IR* names (portability), respect umask

use 0777 and 0666 permissions, it will respect the process umask (generally 0022), so
0755 and 0644 effectively.

Diffstat:
Msfeed_frames.c | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sfeed_frames.c b/sfeed_frames.c @@ -153,8 +153,9 @@ printfeed(FILE *fpitems, FILE *fpin, struct feed *f) parsedtime = 0; strtotime(fields[FieldUnixTimestamp], &parsedtime); - /* content file doesn't exist yet and has write access */ - if ((fd = open(filepath, O_CREAT | O_EXCL | O_WRONLY, 0644)) == -1) { + /* content file doesn't exist yet and has error? */ + if ((fd = open(filepath, O_CREAT | O_EXCL | O_WRONLY, + S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH)) == -1) { if (errno != EEXIST) err(1, "open: %s", filepath); } else {