summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Bloch <m.bloch@samsung.com>2016-10-10 17:12:00 +0200
committerMichal Bloch <m.bloch@samsung.com>2016-10-10 09:20:10 -0700
commit47f641de4382b96e96acd1d1895fd4e609730069 (patch)
tree0deada7c5f973279736ffdd65da73862dea10b7d
parente40a70a28697005e1e34edab14bf7f8e091d2a79 (diff)
downloadlaunchpad-47f641de4382b96e96acd1d1895fd4e609730069.tar.gz
launchpad-47f641de4382b96e96acd1d1895fd4e609730069.tar.bz2
launchpad-47f641de4382b96e96acd1d1895fd4e609730069.zip
Move close_all_fds right before exec
Some FDs (specifically, the ones used for dlog logging) are in use between current close_all_fds call spot and exec Change-Id: Ie64fad2cef350c2e2931da6a3c21200471b23fdb Signed-off-by: Michal Bloch <m.bloch@samsung.com>
-rwxr-xr-xsrc/launchpad.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/launchpad.c b/src/launchpad.c
index e573ea3..a0c8a8b 100755
--- a/src/launchpad.c
+++ b/src/launchpad.c
@@ -489,6 +489,7 @@ static int __normal_fork_exec(int argc, char **argv)
setenv("LD_LIBRARY_PATH", libdir, 1);
free(libdir);
+ _close_all_fds();
if (execv(argv[LOADER_ARG_PATH], argv) < 0) { /* Flawfinder: ignore */
if (errno == EACCES) {
_E("such a file is no executable - %s",
@@ -587,7 +588,6 @@ static int __exec_app_process(void *arg)
__signal_unblock_sigchld();
__signal_fini();
- _close_all_fds();
_delete_sock_path(getpid(), getuid());
PERF("prepare exec - first done");