From f39a31cda09afeaa11b79ddca1f878b27062767a Mon Sep 17 00:00:00 2001 From: "Tate, Hongliang Tian" Date: Wed, 30 Sep 2020 06:03:06 +0000 Subject: [PATCH] Fix a bug in HostEventFd --- src/libos/src/events/host_event_fd.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/libos/src/events/host_event_fd.rs b/src/libos/src/events/host_event_fd.rs index aff80a19..8e44ee17 100644 --- a/src/libos/src/events/host_event_fd.rs +++ b/src/libos/src/events/host_event_fd.rs @@ -65,6 +65,10 @@ impl HostEventFd { /// /// Precondition. The caller must ensure that the host fds are valid. pub unsafe fn write_u64_raw_and_batch(host_fds: &[FileDesc], val: u64) { + if host_fds.len() == 0 { + return; + } + ocall_eventfd_write_batch(host_fds, val); }