=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rup/rup.c,v retrieving revision 1.21 retrieving revision 1.22 diff -c -r1.21 -r1.22 *** src/usr.bin/rup/rup.c 2005/11/17 19:31:54 1.21 --- src/usr.bin/rup/rup.c 2005/11/17 19:55:05 1.22 *************** *** 1,4 **** ! /* $OpenBSD: rup.c,v 1.21 2005/11/17 19:31:54 moritz Exp $ */ /*- * Copyright (c) 1993, John Brezak --- 1,4 ---- ! /* $OpenBSD: rup.c,v 1.22 2005/11/17 19:55:05 moritz Exp $ */ /*- * Copyright (c) 1993, John Brezak *************** *** 29,35 **** */ #ifndef lint ! static char rcsid[] = "$OpenBSD: rup.c,v 1.21 2005/11/17 19:31:54 moritz Exp $"; #endif /* not lint */ #include --- 29,35 ---- */ #ifndef lint ! static char rcsid[] = "$OpenBSD: rup.c,v 1.22 2005/11/17 19:55:05 moritz Exp $"; #endif /* not lint */ #include *************** *** 64,70 **** search_host(struct in_addr addr) { struct host_list *hp; ! if (!hosts) return(0); --- 64,70 ---- search_host(struct in_addr addr) { struct host_list *hp; ! if (!hosts) return(0); *************** *** 143,149 **** 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; --- 143,149 ---- 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,207 **** 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; if (upd != 0) snprintf(days_buf, sizeof days_buf, "%3u day%s, ", upd, --- 196,207 ---- 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; if (upd != 0) snprintf(days_buf, sizeof days_buf, "%3u day%s, ", upd, *************** *** 227,235 **** 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); return(0); } --- 227,235 ---- 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); return(0); } *************** *** 242,248 **** 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, --- 242,248 ---- 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,319 **** usage(); /*NOTREACHED*/ } ! setlinebuf(stdout); if (argc == optind) --- 313,319 ---- usage(); /*NOTREACHED*/ } ! setlinebuf(stdout); if (argc == optind)