From owner-svn-src-all@FreeBSD.ORG Sun Nov 6 18:49:37 2011 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 3AF561065A83; Sun, 6 Nov 2011 18:49:36 +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 609FE8FC15; Sun, 6 Nov 2011 18:49:36 +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 pA6Inafd036032; Sun, 6 Nov 2011 18:49:36 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA6Inadi036029; Sun, 6 Nov 2011 18:49:36 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111061849.pA6Inadi036029@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 18:49:36 +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: r227239 - head/usr.bin/fstat 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: Sun, 06 Nov 2011 18:49:37 -0000 Author: ed Date: Sun Nov 6 18:49:36 2011 New Revision: 227239 URL: http://svn.freebsd.org/changeset/base/227239 Log: Mark global functions and/or variables in fstat(1) static where possible. This allows compilers and static analyzers to more thorough analysis. Modified: head/usr.bin/fstat/fstat.c head/usr.bin/fstat/fuser.c Modified: head/usr.bin/fstat/fstat.c ============================================================================== --- head/usr.bin/fstat/fstat.c Sun Nov 6 18:49:30 2011 (r227238) +++ head/usr.bin/fstat/fstat.c Sun Nov 6 18:49:36 2011 (r227239) @@ -57,13 +57,13 @@ __FBSDID("$FreeBSD$"); #include "functions.h" -int fsflg, /* show files on same filesystem as file(s) argument */ - pflg, /* show files open by a particular pid */ - uflg; /* show files open by a particular (effective) user */ -int checkfile; /* true if restricting to particular files or filesystems */ -int nflg; /* (numerical) display f.s. and rdev as dev_t */ -int mflg; /* include memory-mapped files */ -int vflg; /* be verbose */ +static int fsflg, /* show files on same filesystem as file(s) argument */ + pflg, /* show files open by a particular pid */ + uflg; /* show files open by a particular (effective) user */ +static int checkfile; /* restrict to particular files or filesystems */ +static int nflg; /* (numerical) display f.s. and rdev as dev_t */ +static int mflg; /* include memory-mapped files */ +static int vflg; /* be verbose */ typedef struct devs { struct devs *next; @@ -72,8 +72,8 @@ typedef struct devs { const char *name; } DEVS; -DEVS *devs; -char *memf, *nlistf; +static DEVS *devs; +static char *memf, *nlistf; static int getfname(const char *filename); static void dofiles(struct procstat *procstat, struct kinfo_proc *p); Modified: head/usr.bin/fstat/fuser.c ============================================================================== --- head/usr.bin/fstat/fuser.c Sun Nov 6 18:49:30 2011 (r227238) +++ head/usr.bin/fstat/fuser.c Sun Nov 6 18:49:36 2011 (r227239) @@ -52,7 +52,7 @@ __FBSDID("$FreeBSD$"); /* * File access mode flags table. */ -struct { +static const struct { int flag; char ch; } fflags[] = { @@ -67,7 +67,7 @@ struct { /* * Usage flags translation table. */ -struct { +static const struct { int flag; char ch; } uflags[] = {