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
ba3b422c
Commit
ba3b422c
authored
Aug 21, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
net/SocketDescriptor: make accept4() mandatory on Linux
parent
1f3ce380
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
configure.ac
configure.ac
+1
-1
SocketDescriptor.cxx
src/net/SocketDescriptor.cxx
+3
-3
No files found.
configure.ac
View file @
ba3b422c
...
...
@@ -241,7 +241,7 @@ AC_SEARCH_LIBS([socket], [network socket])
AC_SEARCH_LIBS([gethostbyname], [nsl])
if test x$host_is_linux = xyes; then
AC_CHECK_FUNCS(
accept4
linkat)
AC_CHECK_FUNCS(linkat)
fi
AC_CHECK_FUNCS(getpwnam_r getpwuid_r)
...
...
src/net/SocketDescriptor.cxx
View file @
ba3b422c
...
...
@@ -77,7 +77,7 @@ SocketDescriptor::Close()
SocketDescriptor
SocketDescriptor
::
Accept
()
{
#ifdef
HAVE_ACCEPT4
#ifdef
__linux__
int
connection_fd
=
::
accept4
(
Get
(),
nullptr
,
nullptr
,
SOCK_CLOEXEC
);
#else
int
connection_fd
=
::
accept
(
Get
(),
nullptr
,
nullptr
);
...
...
@@ -90,7 +90,7 @@ SocketDescriptor::Accept()
SocketDescriptor
SocketDescriptor
::
AcceptNonBlock
()
const
{
#ifdef
HAVE_ACCEPT4
#ifdef
__linux__
int
connection_fd
=
::
accept4
(
Get
(),
nullptr
,
nullptr
,
SOCK_CLOEXEC
|
SOCK_NONBLOCK
);
#else
...
...
@@ -105,7 +105,7 @@ SocketDescriptor
SocketDescriptor
::
AcceptNonBlock
(
StaticSocketAddress
&
address
)
const
{
address
.
SetMaxSize
();
#ifdef
HAVE_ACCEPT4
#ifdef
__linux__
int
connection_fd
=
::
accept4
(
Get
(),
address
,
&
address
.
size
,
SOCK_CLOEXEC
|
SOCK_NONBLOCK
);
#else
...
...
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