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)
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to