lxc/0074-lxc-only-add-valid-fd-to-mainloop.patch

29 lines
761 B
Diff
Raw Normal View History

From 0f17217d431458de75d33c4a80ce28eac1bbb2c5 Mon Sep 17 00:00:00 2001
2019-09-30 11:03:07 -04:00
From: tanyifeng <tanyifeng1@huawei.com>
Date: Tue, 26 Mar 2019 16:11:13 +0800
Subject: [PATCH 074/139] lxc: only add valid fd to mainloop
2019-09-30 11:03:07 -04:00
Signed-off-by: tanyifeng <tanyifeng1@huawei.com>
Signed-off-by: LiFeng <lifeng68@huawei.com>
---
src/lxc/mainloop.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/lxc/mainloop.c b/src/lxc/mainloop.c
index b169aa6..9603d1e 100644
2019-09-30 11:03:07 -04:00
--- a/src/lxc/mainloop.c
+++ b/src/lxc/mainloop.c
@@ -85,6 +85,9 @@ int lxc_mainloop_add_handler(struct lxc_epoll_descr *descr, int fd,
struct mainloop_handler *handler;
struct lxc_list *item;
+ if (fd < 0)
+ return 0;
+
handler = malloc(sizeof(*handler));
if (!handler)
return -1;
--
1.8.3.1
2019-09-30 11:03:07 -04:00