From 4065b1ab0a849fb0d96f209a4b7814ebf71c2d17 Mon Sep 17 00:00:00 2001 From: Philippe PITTOLI Date: Thu, 8 Sep 2016 13:23:07 +0200 Subject: [PATCH] pubsubd: test --- pubsub/pubsubd.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pubsub/pubsubd.c b/pubsub/pubsubd.c index f8c6ffd..cfff9e2 100644 --- a/pubsub/pubsubd.c +++ b/pubsub/pubsubd.c @@ -18,6 +18,10 @@ struct worker_params { void * pubsubd_worker_thread (void *params) { struct worker_params *wp = (struct worker_params *) params; + if (wp == NULL) { + fprintf (stderr, "error pubsubd_worker_thread : params NULL\n"); + return NULL; + } while (1) { // each chan has a list of subscribers @@ -30,7 +34,7 @@ void * pubsubd_worker_thread (void *params) struct pubsub_msg m; memset (&m, 0, sizeof (struct pubsub_msg)); - sleep (5); + sleep (5); // TODO DEBUG pubsubd_msg_recv (wp->ale->p, &m); pubsubd_msg_print (&m); @@ -67,7 +71,7 @@ void * pubsubd_worker_thread (void *params) pthread_exit (NULL); } - int +int main(int argc, char **argv, char **env) { struct service srv;