summaryrefslogtreecommitdiff
path: root/ctdb/tcp
diff options
context:
space:
mode:
authorRusty Russell <rusty@rustcorp.com.au>2010-08-18 09:16:31 +0930
committerRusty Russell <rusty@rustcorp.com.au>2010-08-18 09:16:31 +0930
commitf93440c4b7febb67e23580a6217ada832fa6318a (patch)
tree2c86215a1673329bdb3486e6bcd9bb74f2e1088f /ctdb/tcp
parent532e4a7077524c699b88d0b7c02984d5920e1c58 (diff)
downloadsamba-f93440c4b7febb67e23580a6217ada832fa6318a.tar.gz
event: Update events to latest Samba version 0.9.8
In Samba this is now called "tevent", and while we use the backwards compatibility wrappers they don't offer EVENT_FD_AUTOCLOSE: that is now a separate tevent_fd_set_auto_close() function. This is based on Samba version 7f29f817fa939ef1bbb740584f09e76e2ecd5b06. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> (This used to be ctdb commit 85e5e760cc91eb3157d3a88996ce474491646726)
Diffstat (limited to 'ctdb/tcp')
-rw-r--r--ctdb/tcp/tcp_connect.c12
-rw-r--r--ctdb/tcp/tcp_init.c2
-rw-r--r--ctdb/tcp/tcp_io.c2
3 files changed, 10 insertions, 6 deletions
diff --git a/ctdb/tcp/tcp_connect.c b/ctdb/tcp/tcp_connect.c
index 2430764e6cd..d7a0b336877 100644
--- a/ctdb/tcp/tcp_connect.c
+++ b/ctdb/tcp/tcp_connect.c
@@ -19,7 +19,7 @@
*/
#include "includes.h"
-#include "lib/events/events.h"
+#include "lib/tevent/tevent.h"
#include "lib/tdb/include/tdb.h"
#include "system/network.h"
#include "system/filesys.h"
@@ -280,6 +280,7 @@ static int ctdb_tcp_listen_automatic(struct ctdb_context *ctdb)
struct flock lock;
int one = 1;
int sock_size;
+ struct tevent_fd *fde;
/* in order to ensure that we don't get two nodes with the
same adddress, we must make the bind() and listen() calls
@@ -395,8 +396,9 @@ static int ctdb_tcp_listen_automatic(struct ctdb_context *ctdb)
goto failed;
}
- event_add_fd(ctdb->ev, ctcp, ctcp->listen_fd, EVENT_FD_READ|EVENT_FD_AUTOCLOSE,
- ctdb_listen_event, ctdb);
+ fde = event_add_fd(ctdb->ev, ctcp, ctcp->listen_fd, EVENT_FD_READ,
+ ctdb_listen_event, ctdb);
+ tevent_fd_set_auto_close(fde);
close(lock_fd);
return 0;
@@ -419,6 +421,7 @@ int ctdb_tcp_listen(struct ctdb_context *ctdb)
ctdb_sock_addr sock;
int sock_size;
int one = 1;
+ struct tevent_fd *fde;
/* we can either auto-bind to the first available address, or we can
use a specified address */
@@ -469,8 +472,9 @@ int ctdb_tcp_listen(struct ctdb_context *ctdb)
goto failed;
}
- event_add_fd(ctdb->ev, ctcp, ctcp->listen_fd, EVENT_FD_READ|EVENT_FD_AUTOCLOSE,
+ fde = event_add_fd(ctdb->ev, ctcp, ctcp->listen_fd, EVENT_FD_READ,
ctdb_listen_event, ctdb);
+ tevent_fd_set_auto_close(fde);
return 0;
diff --git a/ctdb/tcp/tcp_init.c b/ctdb/tcp/tcp_init.c
index edc10f8ac96..95141d5610d 100644
--- a/ctdb/tcp/tcp_init.c
+++ b/ctdb/tcp/tcp_init.c
@@ -19,7 +19,7 @@
#include "includes.h"
#include "lib/tdb/include/tdb.h"
-#include "lib/events/events.h"
+#include "lib/tevent/tevent.h"
#include "system/network.h"
#include "system/filesys.h"
#include "../include/ctdb_private.h"
diff --git a/ctdb/tcp/tcp_io.c b/ctdb/tcp/tcp_io.c
index 10711d1ea18..bba35decf51 100644
--- a/ctdb/tcp/tcp_io.c
+++ b/ctdb/tcp/tcp_io.c
@@ -18,7 +18,7 @@
*/
#include "includes.h"
-#include "lib/events/events.h"
+#include "lib/tevent/tevent.h"
#include "lib/util/dlinklist.h"
#include "lib/tdb/include/tdb.h"
#include "system/network.h"