From 81ce1c3df2e3e27d87ca054dfaf2294f23d670d9 Mon Sep 17 00:00:00 2001 From: Justinien Bouron Date: Sun, 10 Mar 2019 05:10:06 -0700 Subject: [PATCH] Fix VFS panic "process has two calls" when closing a socket. --- minix/lib/libc/sys/close.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/minix/lib/libc/sys/close.c b/minix/lib/libc/sys/close.c index ac8c7f54c..a0c942aa8 100644 --- a/minix/lib/libc/sys/close.c +++ b/minix/lib/libc/sys/close.c @@ -12,7 +12,12 @@ close(int fd) memset(&m, 0, sizeof(m)); m.m_lc_vfs_close.fd = fd; - m.m_lc_vfs_close.nblock = 0; + + // When closing a socket VFS would output an error message: + // "vfs(1): panic: process has two calls (105, 131)". + // The fix is to make close non-blocking by default. + // There's probably a better way to do this TODO. + m.m_lc_vfs_close.nblock = 1; return _syscall(VFS_PROC_NR, VFS_CLOSE, &m); }