Add some more O_CLOEXEC

This commit is contained in:
Vojtech Bocek
2015-05-29 20:57:41 +02:00
parent 21ec010d5c
commit 68561d8e98
2 changed files with 3 additions and 2 deletions

View File

@@ -25,6 +25,7 @@
#include <dirent.h>
#include <fcntl.h>
#include <cutils/android_reboot.h>
#include <unistd.h>
#ifdef HAVE_SELINUX
#include <selinux/label.h>
@@ -389,7 +390,7 @@ char *run_get_stdout_with_exit(char **cmd, int *exit_code)
char *run_get_stdout_with_exit_with_env(char **cmd, int *exit_code, char *const *envp)
{
int fd[2];
if(pipe(fd) < 0)
if(pipe2(fd, O_CLOEXEC) < 0)
return NULL;
pid_t pid = vfork();

View File

@@ -257,7 +257,7 @@ int main(int argc, char *argv[])
// cryptfs prints informations, we don't want that
stdout_fd = dup(1);
freopen("/dev/null", "a", stdout);
freopen("/dev/null", "ae", stdout);
switch(cmd)
{