mqueue: set non-blocking mode for read/write file descriptors (#122)
This commit is contained in:
parent
36e611a044
commit
6bbb5eb45c
1 changed files with 9 additions and 0 deletions
|
@ -10,6 +10,7 @@
|
|||
#include <re_fmt.h>
|
||||
#include <re_mem.h>
|
||||
#include <re_main.h>
|
||||
#include <re_net.h>
|
||||
#include <re_mqueue.h>
|
||||
#include "mqueue.h"
|
||||
|
||||
|
@ -116,6 +117,14 @@ int mqueue_alloc(struct mqueue **mqp, mqueue_h *h, void *arg)
|
|||
goto out;
|
||||
}
|
||||
|
||||
err = net_sockopt_blocking_set(mq->pfd[0], false);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
err = net_sockopt_blocking_set(mq->pfd[1], false);
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
err = fd_listen(mq->pfd[0], FD_READ, event_handler, mq);
|
||||
if (err)
|
||||
goto out;
|
||||
|
|
Loading…
Add table
Reference in a new issue