englebass pushed a commit to branch master.

commit 6a7f417cec98cd5e84c6bc8e8aefba75b2902a39
Author: Sebastian Dransfeld <[email protected]>
Date:   Wed Aug 7 10:02:05 2013 +0200

    efreet: Check return value of chmod
    
    CID: #1039716
---
 src/bin/efreet/efreetd.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/src/bin/efreet/efreetd.c b/src/bin/efreet/efreetd.c
index f37724a..66ca956 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);

-- 

------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk

Reply via email to