process-util: trivial optimization

This commit is contained in:
Lennart Poettering
2015-08-31 13:20:43 +02:00
parent 03af6492f0
commit a6149b93af
+2 -2
View File
@@ -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");