raster pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=3babdd927a0dfe49b9aa45854bea95bcf0de838b

commit 3babdd927a0dfe49b9aa45854bea95bcf0de838b
Author: Carsten Haitzler (Rasterman) <ras...@rasterman.com>
Date:   Wed Jun 17 16:37:56 2015 +0900

    elm config files - don't write to file if file handle is null
    
    fixes seg with new file only config for elm
---
 src/lib/elm_config.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c
index 92dd8aa..de77af5 100644
--- a/src/lib/elm_config.c
+++ b/src/lib/elm_config.c
@@ -3338,9 +3338,13 @@ _elm_config_sub_init(void)
                           _elm_profile);
    if (!ecore_file_exists(buf))
      {
-        FILE *fp = fopen(buf, "w+");
-        fprintf(fp, "flush");
-        fclose(fp);
+        FILE *f = fopen(buf, "w+");
+
+        if (f)
+          {
+             fprintf(f, "flush");
+             fclose(f);
+          }
      }
    _eio_monitor = eio_monitor_add(buf);
    ecore_event_handler_add(EIO_MONITOR_FILE_MODIFIED, 
_elm_config_file_monitor_cb, NULL);

-- 


Reply via email to