From: GiWoong Kim Date: Tue, 29 Dec 2015 03:53:41 +0000 (+0900) Subject: vl.c: improve error handling while display option parsing X-Git-Tag: TizenStudio_2.0_p2.3.2~111 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8b6b0f7da02dbc81b9aa617fe46a3095b6a40689;p=sdk%2Femulator%2Fqemu.git vl.c: improve error handling while display option parsing Change-Id: I359d40e206815b66cfcc52f5890b4cf74aaf2723 Signed-off-by: GiWoong Kim --- diff --git a/tizen/src/util/error_handler.c b/tizen/src/util/error_handler.c index 04b2f70..e749c6b 100644 --- a/tizen/src/util/error_handler.c +++ b/tizen/src/util/error_handler.c @@ -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; } diff --git a/tizen/src/util/exported_strings.h b/tizen/src/util/exported_strings.h index 8b1850d..2ae8890 100644 --- a/tizen/src/util/exported_strings.h +++ b/tizen/src/util/exported_strings.h @@ -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 --- 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;