svn commit: r229384 - head/usr.sbin/quotaon

Ed Schouten ed at FreeBSD.org
Tue Jan 3 11:08:59 UTC 2012


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)


More information about the svn-src-head mailing list