Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
efa68b29
Commit
efa68b29
authored
Aug 23, 2011
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
contrib: force close-on-exec flag on live555 sockets
parent
a758e7f6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
0 deletions
+50
-0
contrib/src/live555/live-cloexec.patch
contrib/src/live555/live-cloexec.patch
+49
-0
contrib/src/live555/rules.mak
contrib/src/live555/rules.mak
+1
-0
No files found.
contrib/src/live555/live-cloexec.patch
0 → 100644
View file @
efa68b29
Copyright (C) 2011 Rémi Denis-Courmont.
Licensed under GNU General Public License version 2 or higher.
diff -ru live.orig/groupsock/GroupsockHelper.cpp live555/groupsock/GroupsockHelper.cpp
--- live.orig/groupsock/GroupsockHelper.cpp 2011-08-23 18:19:59.000000000 +0300
+++ live/groupsock/GroupsockHelper.cpp 2011-08-23 18:26:32.000000000 +0300
@@ -49,13 +49,33 @@
reuseFlag = 1;
}
+static int makeSocket(int type)
+{
+ int fd;
+
+#ifdef SOCK_CLOEXEC
+ fd = socket(AF_INET, type|SOCK_CLOEXEC, 0);
+ if (fd != -1 || errno != EINVAL)
+ return fd;
+#endif
+
+ fd = socket(AF_INET, type, 0);
+ if (fd == -1)
+ return -1;
+#ifdef FD_CLOEXEC
+ fcntl(fd, F_SETFD, FD_CLOEXEC);
+#endif
+ return fd;
+}
+
+
int setupDatagramSocket(UsageEnvironment& env, Port port) {
if (!initializeWinsockIfNecessary()) {
socketErr(env, "Failed to initialize 'winsock': ");
return -1;
}
- int newSocket = socket(AF_INET, SOCK_DGRAM, 0);
+ int newSocket = makeSocket(SOCK_DGRAM);
if (newSocket < 0) {
socketErr(env, "unable to create datagram socket: ");
return newSocket;
@@ -161,7 +181,7 @@
return -1;
}
- int newSocket = socket(AF_INET, SOCK_STREAM, 0);
+ int newSocket = makeSocket(SOCK_STREAM);
if (newSocket < 0) {
socketErr(env, "unable to create stream socket: ");
return newSocket;
contrib/src/live555/rules.mak
View file @
efa68b29
...
@@ -23,6 +23,7 @@ ifndef HAVE_WINCE
...
@@ -23,6 +23,7 @@ ifndef HAVE_WINCE
patch
-p0
<
$(SRC)
/live555/live-getaddrinfo.patch
patch
-p0
<
$(SRC)
/live555/live-getaddrinfo.patch
endif
endif
endif
endif
patch
-p0
<
$(SRC)
/live555/live-cloexec.patch
mv
live
$@
mv
live
$@
touch
$@
touch
$@
...
...
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