[PATCH] unix_msg: Fix unix_msg_test_drain

Volker Lendecke Volker.Lendecke at SerNet.DE
Thu Dec 4 07:59:23 MST 2014


Hi!

I'd appreciate review&push!

Thanks,

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de
-------------- next part --------------
From 32a1eb4e4b6cf2dc316c0a608048d54003c124a3 Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Thu, 4 Dec 2014 14:50:27 +0000
Subject: [PATCH] unix_msg: Fix unix_msg_test_drain

poll_funcs_init_tevent does not register a tevent context by default. This
used to be the case in an early development stage, but apparently I
haven't tested this for a while :-)

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/lib/unix_msg/test_drain.c |    7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/source3/lib/unix_msg/test_drain.c b/source3/lib/unix_msg/test_drain.c
index 5b6a930..9d74042 100644
--- a/source3/lib/unix_msg/test_drain.c
+++ b/source3/lib/unix_msg/test_drain.c
@@ -18,6 +18,7 @@ static void recv_cb(struct unix_msg_ctx *ctx,
 int main(int argc, const char *argv[])
 {
 	struct poll_funcs *funcs;
+	void *handle;
 	struct sockaddr_un addr;
 	struct unix_msg_ctx *ctx;
 	struct tevent_context *ev;
@@ -45,6 +46,12 @@ int main(int argc, const char *argv[])
 		return 1;
 	}
 
+	handle = poll_funcs_tevent_register(ev, funcs, ev);
+	if (handle == NULL) {
+		fprintf(stderr, "poll_funcs_tevent_register failed\n");
+		exit(1);
+	}
+
 	ret = unix_msg_init(&addr, funcs, 256, 1, recv_cb, &state, &ctx);
 	if (ret != 0) {
 		fprintf(stderr, "unix_msg_init failed: %s\n",
-- 
1.7.9.5



More information about the samba-technical mailing list