diff options
author | ed <ed@FreeBSD.org> | 2012-01-03 11:08:58 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2012-01-03 11:08:58 +0000 |
commit | 2f0ccab6690ab730f79c8e9bdc4b2ae2d4e144a6 (patch) | |
tree | d3ff7f08c94dc2f925737ddb885d4eb87fbe1e54 /usr.sbin/quotaon | |
parent | e8a395e7c137cec3613839af03daa761a64f3bda (diff) | |
download | FreeBSD-src-2f0ccab6690ab730f79c8e9bdc4b2ae2d4e144a6.zip FreeBSD-src-2f0ccab6690ab730f79c8e9bdc4b2ae2d4e144a6.tar.gz |
Simply use getprogname() to obtain the name of the process.
Diffstat (limited to 'usr.sbin/quotaon')
-rw-r--r-- | usr.sbin/quotaon/quotaon.c | 6 |
1 files changed, 2 insertions, 4 deletions
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) |