summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2015-08-28 19:29:03 +0200
committerLennart Poettering <lennart@poettering.net>2015-08-31 13:20:43 +0200
commita6149b93afeb4e7b37e1313920ac2e0a91ff1c08 (patch)
treeebd94a15c5770813edcb8537524f1946d4366392
parent03af6492f071eb202a91eb154a7fc12edcac9087 (diff)
process-util: trivial optimization
-rw-r--r--src/basic/process-util.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/basic/process-util.c b/src/basic/process-util.c
index 61f188467f..cff2d2a034 100644
--- a/src/basic/process-util.c
+++ b/src/basic/process-util.c
@@ -181,10 +181,10 @@ int is_kernel_thread(pid_t pid) {
bool eof;
FILE *f;
- if (pid == 0)
+ if (pid == 0 || pid == 1) /* pid 1, and we ourselves certainly aren't a kernel thread */
return 0;
- assert(pid > 0);
+ assert(pid > 1);
p = procfs_file_alloca(pid, "cmdline");
f = fopen(p, "re");