From owner-svn-src-head@FreeBSD.ORG Sun Nov 6 08:16:42 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 376521066545; Sun, 6 Nov 2011 08:16:42 +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 0D2E78FC1C; Sun, 6 Nov 2011 08:16:42 +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 pA68GffT008908; Sun, 6 Nov 2011 08:16:41 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id pA68GfbF008906; Sun, 6 Nov 2011 08:16:41 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201111060816.pA68GfbF008906@svn.freebsd.org> From: Ed Schouten Date: Sun, 6 Nov 2011 08:16:41 +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: r227178 - head/usr.bin/ruptime X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Nov 2011 08:16:42 -0000 Author: ed Date: Sun Nov 6 08:16:41 2011 New Revision: 227178 URL: http://svn.freebsd.org/changeset/base/227178 Log: Add missing static keywords to ruptime(1) Modified: head/usr.bin/ruptime/ruptime.c Modified: head/usr.bin/ruptime/ruptime.c ============================================================================== --- head/usr.bin/ruptime/ruptime.c Sun Nov 6 08:16:35 2011 (r227177) +++ head/usr.bin/ruptime/ruptime.c Sun Nov 6 08:16:41 2011 (r227178) @@ -54,7 +54,7 @@ __FBSDID("$FreeBSD$"); #include #include -struct hs { +static struct hs { struct whod hs_wd; int hs_nusers; } *hs; @@ -62,19 +62,18 @@ struct hs { #define ISDOWN(h) (now - (h)->hs_wd.wd_recvtime > 11 * 60) #define WHDRSIZE __offsetof(struct whod, wd_we) -size_t nhosts; -time_t now; -int rflg = 1; -DIR *dirp; - -int hscmp(const void *, const void *); -char *interval(time_t, const char *); -int lcmp(const void *, const void *); -void morehosts(void); -void ruptime(const char *, int, int (*)(const void *, const void *)); -int tcmp(const void *, const void *); -int ucmp(const void *, const void *); -void usage(void); +static size_t nhosts; +static time_t now; +static int rflg = 1; +static DIR *dirp; + +static int hscmp(const void *, const void *); +static char *interval(time_t, const char *); +static int lcmp(const void *, const void *); +static void ruptime(const char *, int, int (*)(const void *, const void *)); +static int tcmp(const void *, const void *); +static int ucmp(const void *, const void *); +static void usage(void); int main(int argc, char *argv[]) @@ -119,7 +118,7 @@ main(int argc, char *argv[]) exit(0); } -char * +static char * interval(time_t tval, const char *updown) { static char resbuf[32]; @@ -147,7 +146,7 @@ interval(time_t tval, const char *updown #define HS(a) ((const struct hs *)(a)) /* Alphabetical comparison. */ -int +static int hscmp(const void *a1, const void *a2) { return (rflg * @@ -155,7 +154,7 @@ hscmp(const void *a1, const void *a2) } /* Load average comparison. */ -int +static int lcmp(const void *a1, const void *a2) { if (ISDOWN(HS(a1))) @@ -170,7 +169,7 @@ lcmp(const void *a1, const void *a2) (HS(a2)->hs_wd.wd_loadav[0] - HS(a1)->hs_wd.wd_loadav[0])); } -void +static void ruptime(const char *host, int aflg, int (*cmp)(const void *, const void *)) { struct hs *hsp; @@ -261,7 +260,7 @@ ruptime(const char *host, int aflg, int } /* Number of users comparison. */ -int +static int ucmp(const void *a1, const void *a2) { if (ISDOWN(HS(a1))) @@ -276,7 +275,7 @@ ucmp(const void *a1, const void *a2) } /* Uptime comparison. */ -int +static int tcmp(const void *a1, const void *a2) { return (rflg * ( @@ -288,7 +287,7 @@ tcmp(const void *a1, const void *a2) )); } -void +static void usage(void) { (void)fprintf(stderr, "usage: ruptime [-alrtu] [host ...]\n");