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).
This commit is contained in:
parent
ba8e3f11e2
commit
559a01f585
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user