1 /* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
2 /* vim: set ts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8 #include "UnixFileWatcher.h"
13 UnixFileWatcher::~UnixFileWatcher()
18 UnixFileWatcher::Open(const char* aFilename
, int aFlags
, mode_t aMode
)
20 MOZ_ASSERT(MessageLoopForIO::current() == GetIOLoop());
21 MOZ_ASSERT(aFlags
& O_NONBLOCK
);
23 int fd
= TEMP_FAILURE_RETRY(open(aFilename
, aFlags
, aMode
));
25 OnError("open", errno
);
26 return NS_ERROR_FAILURE
;
34 UnixFileWatcher::UnixFileWatcher(MessageLoop
* aIOLoop
)
35 : UnixFdWatcher(aIOLoop
)
39 UnixFileWatcher::UnixFileWatcher(MessageLoop
* aIOLoop
, int aFd
)
40 : UnixFdWatcher(aIOLoop
, aFd
)