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:
Max Kellermann 2014-08-31 19:07:50 +02:00
parent ba8e3f11e2
commit 559a01f585

View File

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