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

29 lines
762 B
Diff
Raw Normal View History

2019-12-25 15:57:42 +08:00
From 0db36a212db180c7370adaddb427ec5d0a192486 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
2019-12-25 15:57:42 +08:00
Subject: [PATCH 074/131] 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
2019-12-25 15:57:42 +08:00
index b169aa6f..9603d1ee 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;
--
2019-12-25 15:57:42 +08:00
2.23.0
2019-09-30 11:03:07 -04:00