Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Jan 2012 11:08:59 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r229384 - head/usr.sbin/quotaon
Message-ID:  <201201031108.q03B8xh8020837@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed
Date: Tue Jan  3 11:08:58 2012
New Revision: 229384
URL: http://svn.freebsd.org/changeset/base/229384

Log:
  Simply use getprogname() to obtain the name of the process.

Modified:
  head/usr.sbin/quotaon/quotaon.c

Modified: head/usr.sbin/quotaon/quotaon.c
==============================================================================
--- head/usr.sbin/quotaon/quotaon.c	Tue Jan  3 10:36:38 2012	(r229383)
+++ head/usr.sbin/quotaon/quotaon.c	Tue Jan  3 11:08:58 2012	(r229384)
@@ -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)



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201031108.q03B8xh8020837>