library: rename clashing pwcache functions
On MacOS the system already has user_from_uid and group_from_gid. These are renamed pwcache_get_user and pwcache_get_group. For the old library, pwcache_get_user needs to be exported for skill. References: https://gitlab.com/procps-ng/procps/issues/34 Signed-off-by: Craig Small <csmall@enc.com.au>
This commit is contained in:
6
skill.c
6
skill.c
@ -43,7 +43,7 @@
|
||||
#include "proc/pwcache.h"
|
||||
#include "proc/sig.h"
|
||||
#include "proc/devname.h"
|
||||
#include "proc/procps.h" /* char *user_from_uid(uid_t uid) */
|
||||
#include "proc/procps.h" /* char *pwcache_get_user(uid_t uid) */
|
||||
#include "proc/readproc.h"
|
||||
#include "proc/version.h" /* procps_version */
|
||||
#include "rpmatch.h"
|
||||
@ -134,7 +134,7 @@ static void hurt_proc(int tty, int uid, int pid, const char *restrict const cmd,
|
||||
char *buf;
|
||||
size_t len = 0;
|
||||
fprintf(stderr, "%-8s %-8s %5d %-16.16s ? ",
|
||||
(char *)dn_buf, user_from_uid(uid), pid, cmd);
|
||||
(char *)dn_buf, pwcache_get_user(uid), pid, cmd);
|
||||
fflush (stdout);
|
||||
if (getline(&buf, &len, stdin) == -1)
|
||||
return;
|
||||
@ -152,7 +152,7 @@ static void hurt_proc(int tty, int uid, int pid, const char *restrict const cmd,
|
||||
failed = setpriority(PRIO_PROCESS, pid, sig_or_pri);
|
||||
if ((run_time->warnings && failed) || run_time->debugging || run_time->verbose) {
|
||||
fprintf(stderr, "%-8s %-8s %5d %-16.16s ",
|
||||
(char *)dn_buf, user_from_uid(uid), pid, cmd);
|
||||
(char *)dn_buf, pwcache_get_user(uid), pid, cmd);
|
||||
perror("");
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user