[vlc-devel] commit: vlc_execve: simplify, keep standard error ( Rémi Denis-Courmont )
git version control
git at videolan.org
Tue Dec 29 19:34:13 CET 2009
vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Tue Dec 29 20:33:43 2009 +0200| [973bb4a52ca0de732b6152b1f657ad9056da4bcf] | committer: Rémi Denis-Courmont
vlc_execve: simplify, keep standard error
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=973bb4a52ca0de732b6152b1f657ad9056da4bcf
---
src/extras/libc.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/src/extras/libc.c b/src/extras/libc.c
index e55f51a..368f01a 100644
--- a/src/extras/libc.c
+++ b/src/extras/libc.c
@@ -624,9 +624,7 @@ int __vlc_execve( vlc_object_t *p_object, int i_argc, char *const *ppsz_argv,
/* NOTE:
* Like it or not, close can fail (and not only with EBADF)
*/
- if ((close (0) == 0) && (close (1) == 0) && (close (2) == 0)
- && (dup (fds[1]) == 0) && (dup (fds[1]) == 1)
- && (open ("/dev/null", O_RDONLY) == 2)
+ if ((dup2 (fds[1], 0) == 0) && (dup2 (fds[1], 1) == 1)
&& ((psz_cwd == NULL) || (chdir (psz_cwd) == 0)))
execve (ppsz_argv[0], ppsz_argv, ppsz_env);
More information about the vlc-devel
mailing list