From 7a0a849ecfc17b66fc23fc26eefba13959952f84 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Sat, 6 Jan 2018 05:15:08 +0100 Subject: [PATCH] ruptime(1): Staticize and remove a wrong prototype. --- usr.bin/ruptime/ruptime.c | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/usr.bin/ruptime/ruptime.c b/usr.bin/ruptime/ruptime.c index bd2f0fbee3..1a9a65853b 100644 --- a/usr.bin/ruptime/ruptime.c +++ b/usr.bin/ruptime/ruptime.c @@ -29,7 +29,6 @@ * @(#) Copyright (c) 1983, 1993, 1994 The Regents of the University of California. All rights reserved. * @(#)ruptime.c 8.2 (Berkeley) 4/5/94 * $FreeBSD: src/usr.bin/ruptime/ruptime.c,v 1.12.2.1 2000/06/30 09:45:00 ps Exp $ - * $DragonFly: src/usr.bin/ruptime/ruptime.c,v 1.11 2005/09/12 14:35:51 liamfoy Exp $ */ #include @@ -46,7 +45,7 @@ #include #include -struct hs { +static struct hs { struct whod *hs_wd; int hs_nusers; } *hs; @@ -56,17 +55,16 @@ struct hs { #define WHDRSIZE (sizeof(struct whod) - \ sizeof(((struct whod *)NULL)->wd_we)) -size_t nhosts; -time_t now; -int rflg = 1; +static size_t nhosts; +static time_t now; +static int rflg = 1; -int hscmp(const void *, const void *); -char *interval(time_t, const char *); -int lcmp(const void *, const void *); -void morehosts(void); -int tcmp(const void *, const void *); -int ucmp(const void *, const void *); -void usage(void); +static int hscmp(const void *, const void *); +static char *interval(time_t, const char *); +static int lcmp(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[]) @@ -179,7 +177,7 @@ main(int argc, char *argv[]) exit(0); } -char * +static char * interval(time_t tval, const char *updown) { static char resbuf[32]; @@ -207,7 +205,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 * @@ -215,7 +213,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))) @@ -231,7 +229,7 @@ lcmp(const void *a1, const void *a2) } /* Number of users comparison. */ -int +static int ucmp(const void *a1, const void *a2) { if (ISDOWN(HS(a1))) @@ -246,7 +244,7 @@ ucmp(const void *a1, const void *a2) } /* Uptime comparison. */ -int +static int tcmp(const void *a1, const void *a2) { return (rflg * ( @@ -258,7 +256,7 @@ tcmp(const void *a1, const void *a2) )); } -void +static void usage(void) { (void)fprintf(stderr, "usage: ruptime [-alrut]\n"); -- 2.11.4.GIT