lib/nfs/Connection: use class SocketDescriptor

This commit is contained in:
Max Kellermann 2017-08-10 17:29:03 +02:00
parent 39f422ded8
commit 4e113a7086
1 changed files with 5 additions and 5 deletions

View File

@ -22,7 +22,7 @@
#include "Lease.hxx"
#include "Callback.hxx"
#include "event/Loop.hxx"
#include "system/fd_util.h"
#include "net/SocketDescriptor.hxx"
#include "util/RuntimeError.hxx"
extern "C" {
@ -408,12 +408,12 @@ NfsConnection::ScheduleSocket()
SocketMonitor::Steal();
if (!SocketMonitor::IsDefined()) {
int _fd = nfs_get_fd(context);
if (_fd < 0)
SocketDescriptor _fd(nfs_get_fd(context));
if (!_fd.IsDefined())
return;
fd_set_cloexec(_fd, true);
SocketMonitor::Open(_fd);
_fd.EnableCloseOnExec();
SocketMonitor::Open(_fd.Get());
}
SocketMonitor::Schedule(libnfs_to_events(which_events)