Imported Upstream version 2.5.1
[ossec-hids.git] / src / client-agent / start_agent.c
index 45fbf97..c27dc2e 100755 (executable)
@@ -1,11 +1,11 @@
-/* @(#) $Id: start_agent.c,v 1.17 2009/12/01 15:40:07 dcid Exp $ */
+/* @(#) $Id$ */
 
 /* Copyright (C) 2009 Trend Micro Inc.
  * All right reserved.
  *
  * This program is a free software; you can redistribute it
  * and/or modify it under the terms of the GNU General Public
- * License (version 3) as published by the FSF - Free Software
+ * License (version 2) as published by the FSF - Free Software
  * Foundation
  */
 
@@ -39,7 +39,7 @@ int connect_server(int initial_id)
     if(logr->sock >= 0)
     {
         sleep(1);
-        close(logr->sock);
+        CloseSocket(logr->sock);
         logr->sock = -1;
 
         if(logr->rip[1])
@@ -159,6 +159,11 @@ void start_agent(int is_startup)
     memset(cleartext, '\0', OS_MAXSTR +1);
     memset(fmsg, '\0', OS_MAXSTR +1);
     snprintf(msg, OS_MAXSTR, "%s%s", CONTROL_HEADER, HC_STARTUP);
+
+
+    #ifdef ONEWAY
+    return;
+    #endif
     
     
     /* Sending start message and waiting for the ack */