OSDN Git Service

*** empty log message ***
authorkoinec <>
Sun, 28 Feb 2010 03:26:15 +0000 (03:26 +0000)
committerkoinec <>
Sun, 28 Feb 2010 03:26:15 +0000 (03:26 +0000)
deamon/drd64_debugd_dispatch.c
deamon/drd64_debugd_info.h
deamon/drd64_debugd_main.c

index c3fe90a..228d3c2 100644 (file)
@@ -278,7 +278,6 @@ int
        int     i_selects_max;
        int             i_selects_last;
        int             i_resume_flag;
-       int             i_terminate_flag;
        Drd64_Server_RecvStatus         *p_recv;
        struct  timeval         tm_val;
 
@@ -291,8 +290,6 @@ int
        tm_val.tv_sec   = 0;
        tm_val.tv_usec  = 5000;
 
-       i_terminate_flag        = 0x00;
-
        while( 1 )  {
                /* Phase 1: Packet & Signal Polling */
                memcpy( &fds_now, &g_fds_orig, sizeof( struct fd_set ) );
@@ -333,7 +330,7 @@ int
                                                { i_resume_flag = 0x01; }
                                        else if( DRD64_DEBUGD_DISPATCH_RESULT_TERMINATE
                                                                                                        == i_result )    {
-                                               i_terminate_flag = 0xff;
+                                               p_debugd->i_flag_terminate = 0xff;
                                                break;
                                        }
                                        /* 0x01 = Judge 1 : Reading Next */
@@ -343,7 +340,7 @@ int
                        }
 
                        /* Check Terminate Flag => break while loop */
-                       if( 0x00 != i_terminate_flag )  { break; }
+                       if( 0x00 != p_debugd->i_flag_terminate )        { break; }
                        
                        /* Check Restart Packet (RecvStatus) */
                        if( 0x00 != i_resume_flag )
@@ -360,6 +357,9 @@ int
                /* Phase 3: Dispatch Complete-Received Packet */
 
                /* Phase 4: Signal Check & Proc */
+
+               /* Check Terminate Flag => break while loop */
+               if( 0x00 != p_debugd->i_flag_terminate )        { break; }
        }
        
        return 0x00;
index b220003..c43c763 100644 (file)
@@ -63,6 +63,9 @@ typedef struct        {
        char    **ppstr_argv;
        int             i_arg_options;
 
+       /* Mode Flag ------- */
+       int             i_flag_terminate;
+
 } Drd64_Debugd_MasterInformation;
 
 #ifdef DRD64_SRC_DEBUGD_MAIN
index ede1e60..90c62de 100644 (file)
@@ -40,6 +40,24 @@ Comment:
 
 void Drd64_Debugd_SigTerm( siginfo_t *info, ucontext_t *uap)
 {
+       drd64_debugd_info.i_flag_terminate      = 0xff;
+       return;
+}
+
+
+void Drd64_Debugd_SigHup( siginfo_t *info, ucontext_t *uap)
+{
+       drd64_debugd_info.i_flag_terminate      = 0xff;
+       return;
+}
+
+
+int
+       Drd64_Debugd_Terminate(
+               void )
+{
+       DRD64_LOG_INFO("[INFO] Terminating drdebugd");
+
        Drd64_Debugd_Debug_Detach( &drd64_debugd_info );
 
        free( gp_sendbuffer );
@@ -55,13 +73,7 @@ void Drd64_Debugd_SigTerm( siginfo_t *info, ucontext_t *uap)
        DRD64_LOG_INFO("[INFO] Terminate drdebugd. Good-Bye.");
        Drd64_Server_Log_TermLogSystem();
 
-       exit( 0x00 );
-}
-
-
-void Drd64_Debugd_SigHup( siginfo_t *info, ucontext_t *uap)
-{
-       exit( 0x00 );
+       return 0x00;
 }
 
 
@@ -81,6 +93,7 @@ int
        DRD64_LOG_INFO("[INFO]: Booting drdebugd");
 
        p_debugd->str_socketname_debugd[0] = '\0';
+       p_debugd->i_flag_terminate                      = 0x00;
 
        return 0x00;
 }
@@ -297,6 +310,8 @@ int main(
 
        Drd64_Debugd_Dispatch_Polling( &drd64_debugd_info );
 
+       Drd64_Debugd_Terminate();
+
        return 0x00;
 }