]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
process-util: use proc_mounted() check at one more place 31411/head
authorLennart Poettering <lennart@poettering.net>
Tue, 20 Feb 2024 13:39:38 +0000 (14:39 +0100)
committerLennart Poettering <lennart@poettering.net>
Wed, 21 Feb 2024 08:25:46 +0000 (09:25 +0100)
src/basic/process-util.c

index fb8f4ef06ea3f545d48decde2be7765ce64aee34..69635e65f81f9bb727e8de0f254441141c889a43 100644 (file)
@@ -510,7 +510,7 @@ static int get_process_link_contents(pid_t pid, const char *proc_file, char **re
         p = procfs_file_alloca(pid, proc_file);
 
         r = readlink_malloc(p, ret);
-        return r == -ENOENT ? -ESRCH : r;
+        return (r == -ENOENT && proc_mounted() > 0) ? -ESRCH : r;
 }
 
 int get_process_exe(pid_t pid, char **ret) {