=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/rup/rup.c,v retrieving revision 1.20 retrieving revision 1.21 diff -c -r1.20 -r1.21 *** src/usr.bin/rup/rup.c 2003/12/12 05:25:06 1.20 --- src/usr.bin/rup/rup.c 2005/11/17 19:31:54 1.21 *************** *** 1,4 **** ! /* $OpenBSD: rup.c,v 1.20 2003/12/12 05:25:06 deraadt Exp $ */ /*- * Copyright (c) 1993, John Brezak --- 1,4 ---- ! /* $OpenBSD: rup.c,v 1.21 2005/11/17 19:31:54 moritz Exp $ */ /*- * Copyright (c) 1993, John Brezak *************** *** 29,35 **** */ #ifndef lint ! static char rcsid[] = "$OpenBSD: rup.c,v 1.20 2003/12/12 05:25:06 deraadt Exp $"; #endif /* not lint */ #include --- 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 *************** *** 259,265 **** return; } ! print_rup_data(host, &host_stat); clnt_destroy(rstat_clnt); } --- 259,269 ---- return; } ! if (sort_type != SORT_NONE) ! remember_rup_data(host, &host_stat); ! else ! print_rup_data(host, &host_stat); ! clnt_destroy(rstat_clnt); } *************** *** 269,278 **** statstime host_stat; enum clnt_stat clnt_stat; extern char *__progname; - size_t i; if (sort_type != SORT_NONE) { ! printf("collecting responses..."); fflush(stdout); } --- 273,281 ---- statstime host_stat; enum clnt_stat clnt_stat; extern char *__progname; if (sort_type != SORT_NONE) { ! printf("collecting responses...\n"); fflush(stdout); } *************** *** 282,304 **** fprintf(stderr, "%s: %s\n", __progname, clnt_sperrno(clnt_stat)); exit(1); } - - if (sort_type != SORT_NONE) { - putchar('\n'); - qsort(rup_data, rup_data_idx, sizeof(struct rup_data), - compare); - - for (i = 0; i < rup_data_idx; i++) { - print_rup_data(rup_data[i].host, - &rup_data[i].statstime); - } - } } int main(int argc, char *argv[]) { int ch; extern int optind; sort_type = SORT_NONE; --- 285,297 ---- fprintf(stderr, "%s: %s\n", __progname, clnt_sperrno(clnt_stat)); exit(1); } } int main(int argc, char *argv[]) { int ch; + size_t i; extern int optind; sort_type = SORT_NONE; *************** *** 328,333 **** --- 321,336 ---- else { for (; optind < argc; optind++) onehost(argv[optind]); + } + + if (sort_type != SORT_NONE) { + qsort(rup_data, rup_data_idx, sizeof(struct rup_data), + compare); + + for (i = 0; i < rup_data_idx; i++) { + print_rup_data(rup_data[i].host, + &rup_data[i].statstime); + } } exit(0);