Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
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
Commits
25bdf84c
Commit
25bdf84c
authored
Dec 21, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
decomp: use plain fork/exec if POSIX spawn is missing
parent
c2e0af90
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
modules/stream_filter/decomp.c
modules/stream_filter/decomp.c
+23
-0
No files found.
modules/stream_filter/decomp.c
View file @
25bdf84c
...
@@ -27,6 +27,9 @@
...
@@ -27,6 +27,9 @@
#include <vlc_stream.h>
#include <vlc_stream.h>
#include <vlc_network.h>
#include <vlc_network.h>
#include <unistd.h>
#include <unistd.h>
#ifndef _POSIX_SPAWN
# define _POSIX_SPAWN (-1)
#endif
#include <fcntl.h>
#include <fcntl.h>
#include <spawn.h>
#include <spawn.h>
#include <sys/wait.h>
#include <sys/wait.h>
...
@@ -268,6 +271,7 @@ static int Open (stream_t *stream, const char *path)
...
@@ -268,6 +271,7 @@ static int Open (stream_t *stream, const char *path)
cloexec
(
uncomp
[
0
]);
cloexec
(
uncomp
[
0
]);
p_sys
->
read_fd
=
uncomp
[
0
];
p_sys
->
read_fd
=
uncomp
[
0
];
#if (_POSIX_SPAWN >= 0)
posix_spawn_file_actions_t
actions
;
posix_spawn_file_actions_t
actions
;
if
(
posix_spawn_file_actions_init
(
&
actions
)
==
0
)
if
(
posix_spawn_file_actions_init
(
&
actions
)
==
0
)
{
{
...
@@ -291,6 +295,25 @@ static int Open (stream_t *stream, const char *path)
...
@@ -291,6 +295,25 @@ static int Open (stream_t *stream, const char *path)
}
}
posix_spawn_file_actions_destroy
(
&
actions
);
posix_spawn_file_actions_destroy
(
&
actions
);
}
}
#else
/* _POSIX_SPAWN */
switch
(
p_sys
->
pid
=
fork
())
{
case
-
1
:
msg_Err
(
stream
,
"Cannot fork (%m)"
);
break
;
case
0
:
dup2
(
comp
[
0
],
0
);
close
(
comp
[
0
]);
dup2
(
uncomp
[
1
],
1
);
close
(
uncomp
[
1
]);
execlp
(
path
,
path
,
(
char
*
)
NULL
);
exit
(
1
);
/* if we get, execlp() failed! */
default:
if
(
vlc_clone
(
&
p_sys
->
thread
,
Thread
,
stream
,
VLC_THREAD_PRIORITY_INPUT
)
==
0
)
ret
=
VLC_SUCCESS
;
}
#endif
/* _POSIX_SPAWN < 0 */
close
(
uncomp
[
1
]);
close
(
uncomp
[
1
]);
if
(
ret
!=
VLC_SUCCESS
)
if
(
ret
!=
VLC_SUCCESS
)
close
(
uncomp
[
0
]);
close
(
uncomp
[
0
]);
...
...
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