1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-07 18:27:04 +03:00

process-util: trivial optimization

This commit is contained in:
Lennart Poettering 2015-08-28 19:29:03 +02:00
parent 03af6492f0
commit a6149b93af

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");