debugch: Fix not working DEBUGCH
authorMunkyu Im <munkyu.im@samsung.com>
Wed, 30 Jul 2014 07:35:07 +0000 (16:35 +0900)
committerMunkyu Im <munkyu.im@samsung.com>
Wed, 30 Jul 2014 07:46:32 +0000 (16:46 +0900)
Set global variable for checking initailize earlier.

Change-Id: I8585a546992f41f6a07806006afff577c1a9b13a
Signed-off-by: Munkyu Im <munkyu.im@samsung.com>
tizen/src/debug_ch.c

index e2504f56586f1debfc4e2f612ef4f9a325febdbe..1b99279a462c9dfa8f31d72db70751ad033b9537 100644 (file)
@@ -253,6 +253,8 @@ static void debug_init(void)
         return;  /* already initialized */
     }
 
+    nb_debug_options = 0;
+
 #if 0
     strcpy(debugchfile, get_etc_path());
     strcat(debugchfile, "/DEBUGCH");
@@ -270,6 +272,7 @@ static void debug_init(void)
         debug = getenv("DEBUGCH");
     } else {
         if ((tmp = (char *)malloc(1024 + 1)) == NULL){
+            nb_debug_options = -1;
             fclose(fp);
             return;
         }
@@ -281,6 +284,7 @@ static void debug_init(void)
             if (tmp != NULL)
                 free(tmp);
 
+            nb_debug_options = -1;
             return;
         }
         const char* str = fgets(tmp, 1024, fp);
@@ -310,7 +314,6 @@ static void debug_init(void)
             exit(1);
         }
     }
-    nb_debug_options = 0;
 }
 
 int dbg_log(enum _debug_class cls, struct _debug_channel *channel,