polkit: when spawning off agent, wait until the agent is fully initialized

This commit is contained in:
Lennart Poettering
2012-04-11 22:37:48 +02:00
parent 4771148bb9
commit 9bdc770ccd
4 changed files with 30 additions and 5 deletions
+2 -2
View File
@@ -6036,7 +6036,7 @@ int fd_inc_rcvbuf(int fd, size_t n) {
return 1;
}
int fork_agent(pid_t *pid, const char *path, ...) {
int fork_agent(pid_t *pid, const int except[], unsigned n_except, const char *path, ...) {
pid_t parent_pid, agent_pid;
int fd;
bool stdout_is_tty, stderr_is_tty;
@@ -6073,7 +6073,7 @@ int fork_agent(pid_t *pid, const char *path, ...) {
_exit(EXIT_SUCCESS);
/* Don't leak fds to the agent */
close_all_fds(NULL, 0);
close_all_fds(except, n_except);
stdout_is_tty = isatty(STDOUT_FILENO);
stderr_is_tty = isatty(STDERR_FILENO);
+1 -1
View File
@@ -529,6 +529,6 @@ int is_kernel_thread(pid_t pid);
int fd_inc_sndbuf(int fd, size_t n);
int fd_inc_rcvbuf(int fd, size_t n);
int fork_agent(pid_t *pid, const char *path, ...);
int fork_agent(pid_t *pid, const int except[], unsigned n_except, const char *path, ...);
#endif