From 7792309d6df566a4db790149af452d1baf52ef5f Mon Sep 17 00:00:00 2001 From: Stephane Bortzmeyer Date: Tue, 15 Oct 2002 12:58:27 +0000 Subject: [PATCH] Compiles with Sun's compiler (bug #623444) but still problems when running it --- SRC/echoping.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/SRC/echoping.c b/SRC/echoping.c index f7f1c83..1d572ed 100644 --- a/SRC/echoping.c +++ b/SRC/echoping.c @@ -44,9 +44,7 @@ main (argc, argv) extern char *optarg; extern int optind; - /* TODO: Sun's C compiler does not know "signed" (bug #623444). And - getopt returns an int, anyway */ - signed char ch; + int result; int sockfd; struct addrinfo hints, *res; @@ -145,9 +143,10 @@ main (argc, argv) results[i].valid = 0; } progname = argv[0]; - while ((ch = getopt (argc, argv, "vs:n:w:dch:i:rut:f:SCp:P:aA46")) != EOF) + while ((result = + getopt (argc, argv, "vs:n:w:dch:i:rut:f:SCp:P:aA46")) != -1) { - switch (ch) + switch ((char) result) { case 'v': verbose = TRUE; @@ -1193,7 +1192,7 @@ printstats () tvadd (&median, &good_results[successes / 2]); tvavg (&median, 2); } - printf ("Median time: %d.%06d seconds (%.0f bytes per sec.)\n", + printf ("Median time: %d.%06d seconds (%.0f bytes per sec.)\n", (int) median.tv_sec, (int) median.tv_usec, (double) size / tv2double (median)); }