From: Tim Pepper Date: Fri, 28 Sep 2012 00:25:39 +0000 (-0700) Subject: Always chmod our directories. X-Git-Tag: 2.1b_release~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=40ac7b1dd6474373ceb742a5b754f6e95ec69151;p=external%2Fcorewatcher.git Always chmod our directories. I observed the the modes of corewatcher's directories had changed on one of my systems. I don't know what would have caused that, but it led to cores not being recorded in the filesystem. To be robust we create the directories if for some reason they do not exist at start up. Similarly, try to always insure they have the correct permissions at start up. Signed-off-by: Tim Pepper --- diff --git a/src/corewatcher.c b/src/corewatcher.c index 983d3c6..457eb1a 100644 --- a/src/corewatcher.c +++ b/src/corewatcher.c @@ -197,11 +197,11 @@ int main(int argc, char**argv) dir = opendir(core_folder); if (!dir) { mkdir(core_folder, S_IRWXU | S_IRWXG | S_IRWXO | S_ISVTX); - chmod(core_folder, S_IRWXU | S_IRWXG | S_IRWXO | S_ISVTX); dir = opendir(core_folder); if (!dir) return 1; } + chmod(core_folder, S_IRWXU | S_IRWXG | S_IRWXO | S_ISVTX); closedir(dir); dir = opendir(processed_folder); if (!dir) { @@ -211,6 +211,7 @@ int main(int argc, char**argv) if (!dir) return 1; } + chmod(processed_folder, S_IRWXU); closedir(dir); while (1) {