diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-12-22 13:19:56 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-12-25 11:48:21 +0100 |
commit | d00c2631435726b89f55de0510f3ea0133a335b6 (patch) | |
tree | 5bad19e8da03db6c2f4a7ebf61c3e42a9105989a /src/basic | |
parent | 4c253ed1cae8b4df72ce1353ee826a4fae399e25 (diff) | |
download | systemd-d00c2631435726b89f55de0510f3ea0133a335b6.tar.gz |
shutdown: unify shutdown.c's and async.c's sync() helper process
The helper processes are pretty much the same now, let's unify them
hence.
Diffstat (limited to 'src/basic')
-rw-r--r-- | src/basic/async.c | 5 | ||||
-rw-r--r-- | src/basic/async.h | 2 |
2 files changed, 3 insertions, 4 deletions
diff --git a/src/basic/async.c b/src/basic/async.c index 21e05d9c2c..2c51883463 100644 --- a/src/basic/async.c +++ b/src/basic/async.c @@ -60,7 +60,7 @@ finish: return -r; } -int asynchronous_sync(void) { +int asynchronous_sync(pid_t *ret_pid) { int r; /* This forks off an invocation of fork() as a child process, in order to initiate synchronization to @@ -68,7 +68,7 @@ int asynchronous_sync(void) { * original process ever, and a thread would do that as the process can't exit with threads hanging in blocking * syscalls. */ - r = safe_fork("(sd-sync)", FORK_RESET_SIGNALS|FORK_CLOSE_ALL_FDS, NULL); + r = safe_fork("(sd-sync)", FORK_RESET_SIGNALS|FORK_CLOSE_ALL_FDS, ret_pid); if (r < 0) return r; if (r == 0) { @@ -77,7 +77,6 @@ int asynchronous_sync(void) { _exit(EXIT_SUCCESS); } - /* We don' really care about the PID from here on. It will exit when it's done. */ return 0; } diff --git a/src/basic/async.h b/src/basic/async.h index 7eac54d8b2..01c975bb30 100644 --- a/src/basic/async.h +++ b/src/basic/async.h @@ -22,5 +22,5 @@ int asynchronous_job(void* (*func)(void *p), void *arg); -int asynchronous_sync(void); +int asynchronous_sync(pid_t *ret_pid); int asynchronous_close(int fd); |