diff options
author | Moritz Jodeit <moritz@cvs.openbsd.org> | 2005-11-17 19:55:06 +0000 |
---|---|---|
committer | Moritz Jodeit <moritz@cvs.openbsd.org> | 2005-11-17 19:55:06 +0000 |
commit | b576ee6329bd9a75c52d43af23ef0809e1eecf12 (patch) | |
tree | d559c743a943a9c792851feb45b0342f2703259f | |
parent | dcf6e341d44c5818b9b38082d32ee7a20cc9e404 (diff) |
some knf and whitespace cleanup.
-rw-r--r-- | usr.bin/rup/rup.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/usr.bin/rup/rup.c b/usr.bin/rup/rup.c index 1075165d887..924578951fa 100644 --- a/usr.bin/rup/rup.c +++ b/usr.bin/rup/rup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rup.c,v 1.21 2005/11/17 19:31:54 moritz Exp $ */ +/* $OpenBSD: rup.c,v 1.22 2005/11/17 19:55:05 moritz Exp $ */ /*- * Copyright (c) 1993, John Brezak @@ -29,7 +29,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: rup.c,v 1.21 2005/11/17 19:31:54 moritz Exp $"; +static char rcsid[] = "$OpenBSD: rup.c,v 1.22 2005/11/17 19:55:05 moritz Exp $"; #endif /* not lint */ #include <stdio.h> @@ -64,7 +64,7 @@ static int search_host(struct in_addr addr) { struct host_list *hp; - + if (!hosts) return(0); @@ -143,7 +143,7 @@ remember_rup_data(char *host, struct statstime *st) rup_data = newrup; rup_data_max = newsize; } - + if ((rup_data[rup_data_idx].host = strdup(host)) == NULL) err(1, NULL); rup_data[rup_data_idx].statstime = *st; @@ -196,12 +196,12 @@ print_rup_data(char *host, statstime *host_stat) host_stat->curtime.tv_sec -= host_stat->boottime.tv_sec; if (host_stat->curtime.tv_sec > 0) - ups=host_stat->curtime.tv_sec; - upd=ups/(3600*24); - ups-=upd*3600*24; - uph=ups/3600; - ups-=uph*3600; - upm=ups/60; + ups = host_stat->curtime.tv_sec; + upd = ups / (3600 * 24); + ups -= upd * 3600 * 24; + uph = ups / 3600; + ups -= uph * 3600; + upm = ups / 60; if (upd != 0) snprintf(days_buf, sizeof days_buf, "%3u day%s, ", upd, @@ -227,9 +227,9 @@ print_rup_data(char *host, statstime *host_stat) printf(" up %9.9s%9.9s load average: %.2f %.2f %.2f\n", days_buf, hours_buf, - (double)host_stat->avenrun[0]/FSCALE, - (double)host_stat->avenrun[1]/FSCALE, - (double)host_stat->avenrun[2]/FSCALE); + (double)host_stat->avenrun[0] / FSCALE, + (double)host_stat->avenrun[1] / FSCALE, + (double)host_stat->avenrun[2] / FSCALE); return(0); } @@ -242,7 +242,7 @@ onehost(char *host) statstime host_stat; static struct timeval timeout = {25, 0}; extern char *__progname; - + rstat_clnt = clnt_create(host, RSTATPROG, RSTATVERS_TIME, "udp"); if (rstat_clnt == NULL) { fprintf(stderr, "%s: %s", __progname, @@ -313,7 +313,7 @@ main(int argc, char *argv[]) usage(); /*NOTREACHED*/ } - + setlinebuf(stdout); if (argc == optind) |