From owner-svn-src-all@FreeBSD.ORG Tue Jan 3 11:08:59 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68B98106568E; Tue, 3 Jan 2012 11:08:59 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57AAC8FC12; Tue, 3 Jan 2012 11:08:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q03B8xJt020839; Tue, 3 Jan 2012 11:08:59 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q03B8xh8020837; Tue, 3 Jan 2012 11:08:59 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201201031108.q03B8xh8020837@svn.freebsd.org> From: Ed Schouten Date: Tue, 3 Jan 2012 11:08:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r229384 - head/usr.sbin/quotaon X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Jan 2012 11:08:59 -0000 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)