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;
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 ) );
{ 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 */
}
/* 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 )
/* 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;
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 );
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;
}
DRD64_LOG_INFO("[INFO]: Booting drdebugd");
p_debugd->str_socketname_debugd[0] = '\0';
+ p_debugd->i_flag_terminate = 0x00;
return 0x00;
}
Drd64_Debugd_Dispatch_Polling( &drd64_debugd_info );
+ Drd64_Debugd_Terminate();
+
return 0x00;
}