aboutsummaryrefslogtreecommitdiffstats
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
parentefreet: TODO++ (diff)
downloadefl-6a7f417cec98cd5e84c6bc8e8aefba75b2902a39.tar.gz
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[])
char *path;
FILE *log;
- if (!eina_init()) return 1;
-
strcpy(buf, "/tmp/efreetd_XXXXXX");
path = mktemp(buf);
if (!path) return 1;
- chmod(path, 0700);
+ if (chmod(path, 0700) < 0)
+ {
+ perror("chmod");
+ return 1;
+ }
+
log = fopen(path, "wb");
+ if (!log) return 1;
+
+ if (!eina_init()) return 1;
eina_log_print_cb_set(eina_log_print_cb_file, log);
efreetd_log_dom = eina_log_domain_register("efreetd", EFREETD_DEFAULT_LOG_COLOR);