]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/basic/process-util.c
tree-wide: use IN_SET macro (#6977)
[thirdparty/systemd.git] / src / basic / process-util.c
index ab661a8f1632c322965345508a4ce3023b2228c0..a1b50b6c797644ef4737f964842bf8ac53cb97b8 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;