From 2f0ccab6690ab730f79c8e9bdc4b2ae2d4e144a6 Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 3 Jan 2012 11:08:58 +0000 Subject: Simply use getprogname() to obtain the name of the process. --- usr.sbin/quotaon/quotaon.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'usr.sbin/quotaon') diff --git a/usr.sbin/quotaon/quotaon.c b/usr.sbin/quotaon/quotaon.c index d510e80..8d52983 100644 --- a/usr.sbin/quotaon/quotaon.c +++ b/usr.sbin/quotaon/quotaon.c @@ -75,13 +75,11 @@ int main(int argc, char **argv) { struct fstab *fs; - char *whoami; + const char *whoami; long argnum, done = 0; int ch, i, offmode = 0, errs = 0; - whoami = rindex(*argv, '/') + 1; - if (whoami == (char *)1) - whoami = *argv; + whoami = getprogname(); if (strcmp(whoami, "quotaoff") == 0) offmode++; else if (strcmp(whoami, "quotaon") != 0) -- cgit v1.1