summaryrefslogtreecommitdiff
path: root/src/basic
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-06-12 20:57:41 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2016-06-12 21:15:53 -0400
commit4201ce672a267e081ec5ba6f36ae5cf18db8187f (patch)
tree9fe0d18b452b45eabf17fee738fd841c386560bd /src/basic
parent18dade5aaee9f13efb95e6359723974d811c9b1e (diff)
process-util: remove broken support for pid==0
Our functions that query /proc/pid/ support using pid==0 to mean self. get_process_id also seemed to support that, but it was not implemented correctly: the result should be in *uid, not returned, and also it gave completely bogus result when called from get_process_gid(). But afaict, get_process_{uid,gid} were never called with pid==0, so it's not an actual bug. Remove the broken code to avoid confusion.
Diffstat (limited to 'src/basic')
-rw-r--r--src/basic/process-util.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/basic/process-util.c b/src/basic/process-util.c
index f6bde20fc5..08fa98bb9e 100644
--- a/src/basic/process-util.c
+++ b/src/basic/process-util.c
@@ -325,9 +325,6 @@ static int get_process_id(pid_t pid, const char *field, uid_t *uid) {
assert(field);
assert(uid);
- if (pid == 0)
- return getuid();
-
p = procfs_file_alloca(pid, "status");
f = fopen(p, "re");
if (!f) {