summaryrefslogtreecommitdiff
path: root/src/bin/efreet
diff options
context:
space:
mode:
authorSebastian Dransfeld <sebastian.dransfeld@sintef.no>2013-08-07 10:02:05 +0200
committerSebastian Dransfeld <sebastian.dransfeld@sintef.no>2013-08-07 13:02:53 +0200
commit6a7f417cec98cd5e84c6bc8e8aefba75b2902a39 (patch)
tree9160780d55b86d74b81850556a3e50ff585d2bc1 /src/bin/efreet
parent73ad466cbc54fdbe343a2ad559488f8f955237e7 (diff)
efreet: Check return value of chmod
CID: #1039716
Diffstat (limited to 'src/bin/efreet')
-rw-r--r--src/bin/efreet/efreetd.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/bin/efreet/efreetd.c b/src/bin/efreet/efreetd.c
index f37724a304..66ca956f19 100644
--- a/src/bin/efreet/efreetd.c
+++ b/src/bin/efreet/efreetd.c
@@ -30,13 +30,19 @@ main(int argc, char *argv[])
30 char *path; 30 char *path;
31 FILE *log; 31 FILE *log;
32 32
33 if (!eina_init()) return 1;
34
35 strcpy(buf, "/tmp/efreetd_XXXXXX"); 33 strcpy(buf, "/tmp/efreetd_XXXXXX");
36 path = mktemp(buf); 34 path = mktemp(buf);
37 if (!path) return 1; 35 if (!path) return 1;
38 chmod(path, 0700); 36 if (chmod(path, 0700) < 0)
37 {
38 perror("chmod");
39 return 1;
40 }
41
39 log = fopen(path, "wb"); 42 log = fopen(path, "wb");
43 if (!log) return 1;
44
45 if (!eina_init()) return 1;
40 eina_log_print_cb_set(eina_log_print_cb_file, log); 46 eina_log_print_cb_set(eina_log_print_cb_file, log);
41 47
42 efreetd_log_dom = eina_log_domain_register("efreetd", EFREETD_DEFAULT_LOG_COLOR); 48 efreetd_log_dom = eina_log_domain_register("efreetd", EFREETD_DEFAULT_LOG_COLOR);