netlink: Return -EBUSY if some notifier was setup in netlink_notifier_setup
Change-Id: I62d036bb43420934efbf0e9b990ca2cf3dd0b2e5 Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
parent
3421ec90b4
commit
e6c30629a1
1 changed files with 6 additions and 1 deletions
|
|
@ -79,6 +79,11 @@ int netlink_notifier_setup(worker_t worker, FAR struct netlink_conn_s *conn,
|
|||
|
||||
DEBUGASSERT(worker != NULL && conn != NULL);
|
||||
|
||||
if (conn->key > 0)
|
||||
{
|
||||
return -EBUSY;
|
||||
}
|
||||
|
||||
/* This is just a simple wrapper around work_notifer_setup(). */
|
||||
|
||||
info.evtype = WORK_NETLINK_RESPONSE;
|
||||
|
|
@ -88,7 +93,7 @@ int netlink_notifier_setup(worker_t worker, FAR struct netlink_conn_s *conn,
|
|||
info.worker = worker;
|
||||
|
||||
conn->key = work_notifier_setup(&info);
|
||||
return OK;
|
||||
return conn->key;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue