2
0
mirror of git://github.com/lxc/lxc synced 2025-09-04 13:09:34 +00:00

fd: only add valid fd to mainloop

Signed-off-by: dongxinhua <dongxinhua@huawei.com>
This commit is contained in:
dongxinhua
2019-12-21 17:44:40 +08:00
parent 3c3fab0004
commit 4879faffbf

View File

@@ -84,6 +84,8 @@ int lxc_mainloop_add_handler(struct lxc_epoll_descr *descr, int fd,
struct epoll_event ev;
struct mainloop_handler *handler;
struct lxc_list *item;
if (fd < 0)
return -1;
handler = malloc(sizeof(*handler));
if (!handler)