Commit 4e113a70 authored by Max Kellermann's avatar Max Kellermann

lib/nfs/Connection: use class SocketDescriptor

parent 39f422de
......@@ -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)
......
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