Commit 559a01f5 authored by Max Kellermann's avatar Max Kellermann

nfs/Connection: nfs_get_fd() can return -1

While reconnecting to the NFS server, the socket is -1, because there is no socket. Fixes a potential crash (assertion failure).
parent ba8e3f11
......@@ -237,6 +237,9 @@ NfsConnection::ScheduleSocket()
if (!SocketMonitor::IsDefined()) {
int _fd = nfs_get_fd(context);
if (_fd < 0)
return;
fd_set_cloexec(_fd, true);
SocketMonitor::Open(_fd);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment