Merge branch 'write-json-files' into oversampling

This commit is contained in:
Oliver Jowett 2014-11-23 16:34:18 +00:00
commit e0bc89e542
2 changed files with 6 additions and 1 deletions

View file

@ -734,6 +734,7 @@ void modesWriteJson(const char *path)
int fd;
int len = 0;
char *content;
mode_t mask;
snprintf(tmppath, PATH_MAX, "%s.XXXXXX", path);
tmppath[PATH_MAX-1] = 0;
@ -741,6 +742,10 @@ void modesWriteJson(const char *path)
if (fd < 0)
return;
mask = umask(0);
umask(mask);
fchmod(fd, 0644 & ~mask);
content = aircraftsToJson(&len);
if (write(fd, content, len) != len)
goto error_1;