ubase

suckless linux base utils
git clone git://git.2f30.org/ubase
Log | Files | Refs | README | LICENSE

commit 42b640fa21f7afaf77840e1b34be749e27eeb4ae
parent e33f5bed237e860dc16381ae95cdd68f7fc341e7
Author: sin <sin@2f30.org>
Date:   Fri, 16 Aug 2013 16:40:29 +0100

Rename validps() to pidfile()

Diffstat:
Mproc.h | 2+-
Mps.c | 8++++----
Mutil/proc.c | 4++--
3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/proc.h b/proc.h @@ -39,4 +39,4 @@ int parsestat(pid_t pid, struct procstat *ps); int parsestatus(pid_t pid, struct procstatus *pstatus); int proceuid(pid_t pid, uid_t *euid); int procuid(pid_t pid, uid_t *euid); -int validps(const char *path); +int pidfile(const char *file); diff --git a/ps.c b/ps.c @@ -13,7 +13,7 @@ static void usage(void); static void psout(struct procstat *ps); -static void psr(const char *path); +static void psr(const char *file); enum { PS_aflag = 1 << 0, @@ -155,14 +155,14 @@ psout(struct procstat *ps) } static void -psr(const char *path) +psr(const char *file) { struct procstat ps; pid_t pid; - if (!validps(path)) + if (!pidfile(file)) return; - pid = estrtol(path, 10); + pid = estrtol(file, 10); parsestat(pid, &ps); psout(&ps); } diff --git a/util/proc.c b/util/proc.c @@ -95,12 +95,12 @@ parsestatus(pid_t pid, struct procstatus *pstatus) } int -validps(const char *path) +pidfile(const char *file) { char *end; errno = 0; - strtol(path, &end, 10); + strtol(file, &end, 10); if (*end != '\0') return 0; if (errno != 0)