vl.c: improve error handling while display option parsing
authorGiWoong Kim <giwoong.kim@samsung.com>
Tue, 29 Dec 2015 03:53:41 +0000 (12:53 +0900)
committerSeokYeon Hwang <syeon.hwang@samsung.com>
Mon, 4 Jan 2016 11:14:35 +0000 (20:14 +0900)
Change-Id: I359d40e206815b66cfcc52f5890b4cf74aaf2723
Signed-off-by: GiWoong Kim <giwoong.kim@samsung.com>
tizen/src/util/error_handler.c
tizen/src/util/exported_strings.h
vl.c

index 04b2f70..e749c6b 100644 (file)
@@ -302,18 +302,12 @@ static void report(const char *fmt, va_list ap)
 
     // We are wating for '\n'
     if (message[message_len - 1] == '\n') {
-#ifdef CONFIG_QT
-        if (display_type == DT_MARU_QT_ONSCREEN ||
-            display_type == DT_MARU_QT_OFFSCREEN) {
-            start_qt5_msgbox(CRITICAL_ICON, message);
-        }
-#endif
-#ifdef CONFIG_JAVA_UI
-        if (display_type == DT_MARU_SDL ||
-            display_type == DT_MARU_SHM) {
-            start_simple_client(message);
-        }
+#if defined(CONFIG_QT)
+        start_qt5_msgbox(CRITICAL_ICON, message);
+#elif defined(CONFIG_JAVA_UI)
+        start_simple_client(message);
 #endif
+
         message[0] = '\0';
         message_len = 0;
     }
index 8b1850d..2ae8890 100644 (file)
@@ -42,6 +42,7 @@
 #define FAILED_TO_INSTALL_EXTRAPACKAGE_1 "Extra package installation is failed.\n"
 #define FAILED_TO_INSTALL_EXTRAPACKAGE_2 " must be installed MANUALLY!"
 #define EMULATOR_HAS_STOPPED "Emulator has stopped working.\nA problem caused the program to stop working correctly."
+#define FAILED_TO_DISPLAY_PARSING "A missing or invalid option was found during display option parsing."
 
 /* hax error strings */
 #define NO_ACCELERATOR_FOUND "No accelerator found."
diff --git a/vl.c b/vl.c
index e1cfa7a..c4af1d3 100644 (file)
--- a/vl.c
+++ b/vl.c
@@ -143,6 +143,7 @@ int qemu_main(int argc, char **argv, char **envp);
 #include "tizen/src/util/ui_operations.h"
 #include "tizen/src/ecs/ecs.h"
 #include "tizen/src/util/error_handler.h"
+#include "tizen/src/util/exported_strings.h"
 # ifdef CONFIG_JAVA_UI
 #include "tizen/src/display/maru_display.h"
 # endif
@@ -2299,7 +2300,7 @@ static DisplayType select_display(const char *p)
                 nextopt = endptr;
             } else {
             invalid_maru_qt_args:
-                fprintf(stderr, "Invalid maru_qt option string: %s\n", p);
+                error_report(FAILED_TO_DISPLAY_PARSING);
                 exit(1);
             }
             opts = nextopt;