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.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2016-06-12 21:15:53 -04:00
parent 18dade5aae
commit 4201ce672a
-3
View File
@@ -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) {