Index: include/usage.h =================================================================== RCS file: /var/cvs/busybox/include/usage.h,v retrieving revision 1.213 diff -u -b -B -w -p -r1.213 usage.h --- a/include/usage.h 5 Jun 2004 07:58:17 -0000 1.213 +++ b/include/usage.h 7 Jun 2004 20:43:54 -0000 @@ -1880,6 +1880,7 @@ "Options:\n" \ "\t-c COUNT\tSend only COUNT pings.\n" \ "\t-s SIZE\t\tSend SIZE data bytes in packets (default=56).\n" \ + "\t-w DEADLINE\tSpecify a timeout, in seconds, before ping exits.\n" \ "\t-q\t\tQuiet mode, only displays output at start\n" \ "\t\t\tand when finished." #endif Index: networking/ping.c =================================================================== RCS file: /var/cvs/busybox/networking/ping.c,v retrieving revision 1.56 diff -u -b -B -w -p -r1.56 ping.c --- a/networking/ping.c 15 Mar 2004 08:28:48 -0000 1.56 +++ b/networking/ping.c 7 Jun 2004 20:43:54 -0000 @@ -57,8 +57,8 @@ static const int MAXIPLEN = 60; static const int MAXICMPLEN = 76; static const int MAXPACKET = 65468; #define MAX_DUP_CHK (8 * 128) -static const int MAXWAIT = 10; static const int PINGINTERVAL = 1; /* second */ +static int MAXWAIT = 10; #define O_QUIET (1 << 0) @@ -420,6 +420,12 @@ extern int ping_main(int argc, char **ar argv++; datalen = atoi(*argv); break; + case 'w': + if (--argc <= 0) + bb_show_usage(); + argv++; + MAXWAIT = atoi(*argv); + break; default: bb_show_usage(); }