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
737267ce
Commit
737267ce
authored
6 years ago
by
1848
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved call to fchmod() on socket from OneServerSocket::Open() to socket_bind_listen()
parent
84054203
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
ServerSocket.cxx
src/event/ServerSocket.cxx
+0
-8
SocketUtil.cxx
src/net/SocketUtil.cxx
+10
-0
No files found.
src/event/ServerSocket.cxx
View file @
737267ce
...
@@ -39,7 +39,6 @@
...
@@ -39,7 +39,6 @@
#include <string>
#include <string>
#include <algorithm>
#include <algorithm>
#include <sys/stat.h>
#include <string.h>
#include <string.h>
#include <unistd.h>
#include <unistd.h>
#include <assert.h>
#include <assert.h>
...
@@ -184,13 +183,6 @@ OneServerSocket::Open()
...
@@ -184,13 +183,6 @@ OneServerSocket::Open()
SOCK_STREAM
,
0
,
SOCK_STREAM
,
0
,
address
,
5
);
address
,
5
);
#ifdef HAVE_UN
/* allow everybody to connect */
if
(
!
path
.
IsNull
())
fchmod
(
_fd
.
Get
(),
0666
);
#endif
/* register in the EventLoop */
/* register in the EventLoop */
SetFD
(
_fd
.
Release
());
SetFD
(
_fd
.
Release
());
...
...
This diff is collapsed.
Click to expand it.
src/net/SocketUtil.cxx
View file @
737267ce
...
@@ -23,6 +23,8 @@
...
@@ -23,6 +23,8 @@
#include "SocketError.hxx"
#include "SocketError.hxx"
#include "UniqueSocketDescriptor.hxx"
#include "UniqueSocketDescriptor.hxx"
#include <sys/stat.h>
UniqueSocketDescriptor
UniqueSocketDescriptor
socket_bind_listen
(
int
domain
,
int
type
,
int
protocol
,
socket_bind_listen
(
int
domain
,
int
type
,
int
protocol
,
SocketAddress
address
,
SocketAddress
address
,
...
@@ -32,6 +34,14 @@ socket_bind_listen(int domain, int type, int protocol,
...
@@ -32,6 +34,14 @@ socket_bind_listen(int domain, int type, int protocol,
if
(
!
fd
.
CreateNonBlock
(
domain
,
type
,
protocol
))
if
(
!
fd
.
CreateNonBlock
(
domain
,
type
,
protocol
))
throw
MakeSocketError
(
"Failed to create socket"
);
throw
MakeSocketError
(
"Failed to create socket"
);
#ifdef HAVE_UN
if
(
domain
==
AF_UNIX
)
{
/* allow everybody to connect */
fchmod
(
fd
.
Get
(),
0666
);
}
#endif
if
(
!
fd
.
SetReuseAddress
())
if
(
!
fd
.
SetReuseAddress
())
throw
MakeSocketError
(
"setsockopt() failed"
);
throw
MakeSocketError
(
"setsockopt() failed"
);
...
...
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