persistent: reduce indentation for the finishing moves in ctdb_persistent_callback
[sahlberg/ctdb.git] / common / system_linux.c
index 7a580cc584c8f9ef4cbf192ea5a82315b2a9009d..a498ab2d686999f6b596d526e2b3f8736f1ef64f 100644 (file)
@@ -23,7 +23,7 @@
 #include "system/filesys.h"
 #include "system/wait.h"
 #include "../include/ctdb_private.h"
-#include "lib/events/events.h"
+#include "lib/tevent/tevent.h"
 #include <netinet/if_ether.h>
 #include <netinet/ip6.h>
 #include <netinet/icmp6.h>
@@ -92,9 +92,11 @@ int ctdb_sys_send_arp(const ctdb_sock_addr *addr, const char *iface)
                        return -1;
                }
 
+               DEBUG(DEBUG_DEBUG, (__location__ " Created SOCKET FD:%d for sending arp\n", s));
                strncpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name));
                if (ioctl(s, SIOCGIFINDEX, &ifr) < 0) {
                        DEBUG(DEBUG_CRIT,(__location__ " interface '%s' not found\n", iface));
+                       close(s);
                        return -1;
                }
 
@@ -171,6 +173,7 @@ int ctdb_sys_send_arp(const ctdb_sock_addr *addr, const char *iface)
                ret = sendto(s, buffer, 64, 0, (struct sockaddr *)&sall, sizeof(sall));
                if (ret < 0 ){
                        DEBUG(DEBUG_CRIT,(__location__ " failed sendto\n"));
+                       close(s);
                        return -1;
                }
 
@@ -183,9 +186,11 @@ int ctdb_sys_send_arp(const ctdb_sock_addr *addr, const char *iface)
                        return -1;
                }
 
+               DEBUG(DEBUG_DEBUG, (__location__ " Created SOCKET FD:%d for sending arp\n", s));
                strncpy(ifr.ifr_name, iface, sizeof(ifr.ifr_name));
                if (ioctl(s, SIOCGIFINDEX, &ifr) < 0) {
                        DEBUG(DEBUG_CRIT,(__location__ " interface '%s' not found\n", iface));
+                       close(s);
                        return -1;
                }
 
@@ -422,6 +427,8 @@ int ctdb_sys_open_capture_socket(const char *iface, void **private_data)
                return -1;
        }
 
+       DEBUG(DEBUG_DEBUG, (__location__ " Created RAW SOCKET FD:%d for tcp tickle\n", s));
+
        set_nonblocking(s);
        set_close_on_exec(s);