From effa40da764723756dc1977dcf0e074ef990cb86 Mon Sep 17 00:00:00 2001 From: Julio Montes Date: Thu, 10 Dec 2015 14:39:45 -0600 Subject: [PATCH] fix chmod in write_file function --- src/lib.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib.c b/src/lib.c index 174a1ff..4cf266d 100644 --- a/src/lib.c +++ b/src/lib.c @@ -144,6 +144,11 @@ bool write_file(const GString* data, const gchar* file_path, int oflags, mode_t result = false; } + if (fchmod(fd, mode) == -1) { + LOG(MOD "Cannot change mode file '%s'", (char*)file_path); + result = false; + } + if (close(fd) == -1) { LOG(MOD "Cannot close file '%s'", (char*)file_path); result = false;