raw-clone: beef up raw_clone() wrapper a bit

First of all, let's return pid_t, which appears to be the correct type
given that we return PIDs, and it#s what fork() uses too.

Most importantly though, flush out our PID cache, so that the call
becomes compatible with our getpid_cached() logic.
This commit is contained in:
Lennart Poettering
2018-01-04 13:27:26 +01:00
parent 3139096321
commit 799a960d1f
3 changed files with 24 additions and 21 deletions
+1 -1
View File
@@ -1083,7 +1083,7 @@ int ioprio_parse_priority(const char *s, int *ret) {
static pid_t cached_pid = CACHED_PID_UNSET;
static void reset_cached_pid(void) {
void reset_cached_pid(void) {
/* Invoked in the child after a fork(), i.e. at the first moment the PID changed */
cached_pid = CACHED_PID_UNSET;
}