OSDN Git Service

*** empty log message ***
authorkoinec <>
Sun, 28 Feb 2010 03:12:27 +0000 (03:12 +0000)
committerkoinec <>
Sun, 28 Feb 2010 03:12:27 +0000 (03:12 +0000)
deamon/drd64_debugd_cmd_detach.c [new file with mode: 0644]
deamon/drd64_debugd_dispatch.c
deamon/drd64_debugd_dispatch.h

diff --git a/deamon/drd64_debugd_cmd_detach.c b/deamon/drd64_debugd_cmd_detach.c
new file mode 100644 (file)
index 0000000..8d2ca50
--- /dev/null
@@ -0,0 +1,68 @@
+/*DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64
+
+                         D r . D e a m o n  6 4
+                        for INTEL64(R), AMD64(R)
+       
+   Copyright(C) 2007-2009 Koine Yuusuke(koinec). All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright notice,
+    this list of conditions and the following disclaimer.
+ 2. Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY Koine Yuusuke(koinec) ``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL Koine Yuusuke(koinec) OR CONTRIBUTORS BE
+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+OF THE POSSIBILITY OF SUCH DAMAGE.
+
+DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64DrDeAmOn64*/
+
+/* File Info -----------------------------------------------------------
+File: drd64_.c
+Function: 
+Comment: 
+----------------------------------------------------------------------*/
+
+#include"drd64_debugd.h"
+
+int
+       Drd64_Debugd_Cmd_Detach(
+               int             i_recv_id,
+               Drd64_PacketHeader      *p_phead,
+               Drd64_Debugd_MasterInformation  *p_debugd )
+{
+       int             i_wlen;
+       int             i_fds;
+       Drd64_Server_RecvStatus         *p_recv;
+
+       DRD64_LOG_VERBOSE("[STAT] CMD: Detach Start ");
+
+       p_recv  = Drd64_Server_RecvStatus_GetRecvStatus( i_recv_id );
+       assert( NULL != p_recv );
+       i_fds   = p_recv->i_fds_id;
+
+       p_phead->w_packettype   |= DRD64_PACKETTYPE_FLAG_ANSWER;
+
+       i_wlen  = send( i_fds, (void *)p_phead, DRD64_PacketSize(p_phead), 0x00);
+       DRD64_DEBUG_PRINT("send",i_wlen,"FD",i_fds,"errno",errno);
+       if( i_wlen != DRD64_PacketSize(p_phead) )
+               { return DRD64_DEBUGD_DISPATCH_RESULT_CLOSE; }
+
+       DRD64_LOG_VERBOSE("[STAT] CMD: Detach Ended ");
+
+       return DRD64_DEBUGD_DISPATCH_RESULT_TERMINATE;
+}
+
+
+/* EOF of drd64_.c ----------------------------------- */
index a7f09da..c3fe90a 100644 (file)
@@ -332,8 +332,10 @@ int
                                        else if( DRD64_DEBUGD_DISPATCH_RESULT_RESTART == i_result )
                                                { i_resume_flag = 0x01; }
                                        else if( DRD64_DEBUGD_DISPATCH_RESULT_TERMINATE
-                                                                                                                       == i_result )
-                                               { i_terminate_flag = 0xff;break; }
+                                                                                                       == i_result )    {
+                                               i_terminate_flag = 0xff;
+                                               break;
+                                       }
                                        /* 0x01 = Judge 1 : Reading Next */
                                }
 
@@ -341,9 +343,7 @@ int
                        }
 
                        /* Check Terminate Flag => break while loop */
-                       /*if( 0x00 != i_terminate_flag )        {
-                               break;
-                       }*/
+                       if( 0x00 != i_terminate_flag )  { break; }
                        
                        /* Check Restart Packet (RecvStatus) */
                        if( 0x00 != i_resume_flag )
index 4deed13..311bb5e 100644 (file)
@@ -42,6 +42,7 @@ Comment:
 #define        DRD64_DEBUGD_DISPATCH_RESULT_COMPLETE   0x02
 #define        DRD64_DEBUGD_DISPATCH_RESULT_RESTART    0x03
 #define        DRD64_DEBUGD_DISPATCH_RESULT_POLL               0x04
+#define        DRD64_DEBUGD_DISPATCH_RESULT_TERMINATE  0x99
 //#define      DRD64_DEBUGD_DISPATCH_RESULT_SETCLIENT  0x05
 
 #endif /* DRD64_HEADER_DEBUGD_DISPATCH */