From a8f3c3651a57dd3a5525915d801c206a98369d35 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 27 Nov 2019 19:31:23 -0600 Subject: [PATCH] net/netlink/netlink_conn.c: Use nxsig_queue() instead of nxsig_kill() so that we can pass a reference to the connection structure with the signal. --- net/netlink/netlink_conn.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/net/netlink/netlink_conn.c b/net/netlink/netlink_conn.c index 7b8cd369c9..c46a103363 100644 --- a/net/netlink/netlink_conn.c +++ b/net/netlink/netlink_conn.c @@ -137,10 +137,21 @@ static void netlink_notify_waiters(FAR struct netlink_conn_s *conn) { if (conn->waiter[i] > 0) { - ret = nxsig_kill(conn->waiter[i], CONFIG_NETLINK_SIGNAL); +#ifdef CONFIG_CAN_PASS_STRUCTS + union sigval value; + + /* Send the CONFIG_NETLINK_SIGNAL signal to the waiter. */ + + value.sival_ptr = conn; + ret = nxsig_queue((int)conn->waiter[i], + (int)CONFIG_NETLINK_SIGNAL, value); +#else + ret = nxsig_queue((int)conn->waiter[i], + (int)CONFIG_NETLINK_SIGNAL, conn); +#endif if (ret < 0) - { - nerr("ERROR: nxsig_kill() failed: %d\n", ret); + { + nerr("ERROR: nxsig_queue() failed: %d\n", ret); UNUSED(ret); }