]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/basic/process-util.c
Merge pull request #6974 from keszybz/clean-up-defines
[thirdparty/systemd.git] / src / basic / process-util.c
index 8e94f969c38714c2633c117322deb2b7091a8f65..b1cdc4257d59dc5c1a3c7fb3ab0b65ceb4abd9b4 100644 (file)
@@ -392,7 +392,7 @@ int is_kernel_thread(pid_t pid) {
         bool eof;
         FILE *f;
 
-        if (pid == 0 || pid == 1 || pid == getpid_cached()) /* pid 1, and we ourselves certainly aren't a kernel thread */
+        if (IN_SET(pid, 0, 1) || pid == getpid_cached()) /* pid 1, and we ourselves certainly aren't a kernel thread */
                 return 0;
 
         assert(pid > 1);
@@ -817,7 +817,7 @@ bool pid_is_alive(pid_t pid) {
                 return true;
 
         r = get_process_state(pid);
-        if (r == -ESRCH || r == 'Z')
+        if (IN_SET(r, -ESRCH, 'Z'))
                 return false;
 
         return true;