Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
0c1a0016
Commit
0c1a0016
authored
Aug 06, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
system/Event{FD,Pipe}: throw exception on error
parent
148c38fb
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
4 deletions
+13
-4
Loop.hxx
src/event/Loop.hxx
+4
-0
EventFD.cxx
src/system/EventFD.cxx
+2
-2
EventFD.hxx
src/system/EventFD.hxx
+3
-2
EventPipe.hxx
src/system/EventPipe.hxx
+4
-0
No files found.
src/event/Loop.hxx
View file @
0c1a0016
...
...
@@ -116,7 +116,11 @@ class EventLoop final : SocketMonitor
ThreadId
thread
=
ThreadId
::
Null
();
public
:
/**
* Throws on error.
*/
explicit
EventLoop
(
ThreadId
_thread
);
EventLoop
()
:
EventLoop
(
ThreadId
::
GetCurrent
())
{}
~
EventLoop
()
noexcept
;
...
...
src/system/EventFD.cxx
View file @
0c1a0016
...
...
@@ -20,7 +20,7 @@
#include "config.h"
#ifdef USE_EVENTFD
#include "EventFD.hxx"
#include "system/
Fatal
Error.hxx"
#include "system/Error.hxx"
#include "Compiler.h"
#include <assert.h>
...
...
@@ -29,7 +29,7 @@
EventFD
::
EventFD
()
{
if
(
!
fd
.
CreateEventFD
(
0
))
FatalSystemError
(
"eventfd() failed"
);
throw
MakeErrno
(
"eventfd() failed"
);
}
bool
...
...
src/system/EventFD.hxx
View file @
0c1a0016
...
...
@@ -25,13 +25,14 @@
/**
* A class that wraps eventfd().
*
* Errors in the constructor are fatal.
*/
class
EventFD
{
UniqueFileDescriptor
fd
;
public
:
/**
* Throws on error.
*/
EventFD
();
int
Get
()
const
{
...
...
src/system/EventPipe.hxx
View file @
0c1a0016
...
...
@@ -31,7 +31,11 @@ class EventPipe {
int
fds
[
2
];
public
:
/**
* Throws on error.
*/
EventPipe
();
~
EventPipe
();
EventPipe
(
const
EventPipe
&
other
)
=
delete
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment