Fix VFS panic "process has two calls" when closing a socket.

This commit is contained in:
Justinien Bouron 2019-03-10 05:10:06 -07:00
parent 7d8d1b64b9
commit 81ce1c3df2

View File

@ -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);
}