[Title] shutdown gracefully when skin process is terminated
authorgiwoong.kim <giwoong.kim@samsung.com>
Fri, 31 Aug 2012 07:31:34 +0000 (16:31 +0900)
committergiwoong.kim <giwoong.kim@samsung.com>
Fri, 31 Aug 2012 07:39:01 +0000 (16:39 +0900)
[Type] enhancement
[Module] Emulator / skin
[Priority] major
[Jira#]
[Redmine#]
[Problem]
[Cause]
[Solution]
[TestCase]

tizen/src/skin/maruskin_client.c
tizen/src/skin/maruskin_server.c

index 2af4546058020a76ed02e11fc2453c0ab46308f8..351cb56f3798062c343ea212133565d01853cd90 100644 (file)
@@ -170,9 +170,9 @@ static void* run_skin_client(void* arg)
         INFO("child return value : %d\n", dwRet);
 
         if (dwRet != 0) {
-            //child process is terminated with some problem.
-            //so qemu process will terminate, too. immediately.
-            exit(1);
+            /child process is terminated with some problem.
+            So qemu process will terminate, too. immediately. */
+            shutdown_qemu_gracefully();
         }
 
         if (CloseHandle(pi.hProcess) != 0) {
@@ -196,9 +196,9 @@ static void* run_skin_client(void* arg)
         INFO("child return value : %d\n", ret);
 
         if (ret != 0) {
-            //child process is terminated with some problem.
-            //so qemu process will terminate, too. immediately.
-            exit(1);
+            /child process is terminated with some problem.
+            So qemu process will terminate, too. immediately. */
+            shutdown_qemu_gracefully();
         }
     }
 
index 0f82ce88495b3932d057838a25b38052a4242762..c4591290f20bbd07a3635ce693dd6b286d4bb64e 100644 (file)
@@ -230,6 +230,7 @@ void shutdown_skin_server( void ) {
 #else
         close( client_sock );
 #endif
+        client_sock = 0;
     }
 
     if ( close_server_socket ) {
@@ -240,6 +241,7 @@ void shutdown_skin_server( void ) {
 #else
             close( server_sock );
 #endif
+            server_sock = 0;
         }
     }
 
@@ -841,6 +843,7 @@ cleanup:
 #else
         close( server_sock );
 #endif
+        server_sock = 0;
     }
 
     if( shutdown_qmu ) {
@@ -1091,6 +1094,7 @@ static void* do_heart_beat( void* args ) {
 #else
                         close( client_sock );
 #endif
+                        client_sock = 0;
                     }
 
                     start_skin_client( skin_argc, skin_argv );
@@ -1114,6 +1118,7 @@ static void* do_heart_beat( void* args ) {
 #else
             close( client_sock );
 #endif
+            client_sock = 0;
         }
 
         stop_server = 1;
@@ -1123,6 +1128,7 @@ static void* do_heart_beat( void* args ) {
 #else
             close( server_sock );
 #endif
+            server_sock = 0;
         }
 
         ERR( "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n" );