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
8c832f4c
Commit
8c832f4c
authored
7 years ago
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
system/FileDescriptor: use std::exchange()
parent
31bad5f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
FileDescriptor.hxx
src/system/FileDescriptor.hxx
+3
-5
No files found.
src/system/FileDescriptor.hxx
View file @
8c832f4c
...
...
@@ -33,6 +33,8 @@
#include "check.h"
#include "Compiler.h"
#include <utility>
#include <assert.h>
#include <unistd.h>
#include <sys/types.h>
...
...
@@ -75,11 +77,7 @@ public:
}
int
Steal
()
noexcept
{
assert
(
IsDefined
());
int
_fd
=
fd
;
fd
=
-
1
;
return
_fd
;
return
std
::
exchange
(
fd
,
-
1
);
}
void
SetUndefined
()
noexcept
{
...
...
This diff is collapsed.
Click to expand it.
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