Fixed code style 03/171103/2
authorMateusz Moscicki <m.moscicki2@partner.samsung.com>
Mon, 26 Feb 2018 07:17:53 +0000 (08:17 +0100)
committerMateusz Moscicki <m.moscicki2@partner.samsung.com>
Tue, 27 Feb 2018 08:40:42 +0000 (09:40 +0100)
Code has been changed to avoid messages:

  (CODE_SMELL/Warning) Remove this unused "ret" local variable.
  (CODE_SMELL/Warning) Remove this unused "command" local variable.

In addition, the code has been modified to remove unnecessary bracket.

Change-Id: I5bf9820d16f7b7947844e078eba9a1bab11ddd6c

src/crash-manager/crash-manager.c

index f25c486..580cb3c 100644 (file)
@@ -450,8 +450,11 @@ static int dump_system_state(void)
 }
 static void execute_crash_modules(int argc, char *argv[])
 {
+
+#if defined(TIZEN_ENABLE_COREDUMP) || defined(TIZEN_FEATURE_PTRACE_CALLSTACK)
        int ret;
        char command[PATH_MAX];
+#endif
 
 #ifdef TIZEN_ENABLE_COREDUMP
        /* Execute crash-pipe */
@@ -471,7 +474,8 @@ static void execute_crash_modules(int argc, char *argv[])
 # ifdef SYS_ASSERT
        /* Use ptrace version as fallback if sys-assert failed to
         * generate report */
-       if (!crash_info.have_sysassert_report) {
+       if (crash_info.have_sysassert_report)
+               return;
 # endif
        /* Execute crash-stack */
        if (argc > 8)
@@ -493,11 +497,8 @@ static void execute_crash_modules(int argc, char *argv[])
                _E("Failed to snprintf for crash-stack command");
                return;
        }
-       system_command(command);
 
-# ifdef SYS_ASSERT
-       }
-# endif
+       system_command(command);
 #endif /* TIZEN_FEATURE_PTRACE_CALLSTACK */
 }