lib/nfs/Connection: use class SocketDescriptor
This commit is contained in:
parent
39f422ded8
commit
4e113a7086
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue