mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-05-14 13:29:25 +08:00
PING(8): Fix initialization and cleanup
This commit is contained in:
parent
e24c90c55f
commit
e48f546574
@ -229,23 +229,39 @@ int rtems_bsd_command_ping(int argc, char *argv[])
|
|||||||
|
|
||||||
rtems_bsd_program_lock();
|
rtems_bsd_program_lock();
|
||||||
|
|
||||||
|
memset(&rcvd_tbl[0], 0, sizeof(rcvd_tbl));
|
||||||
|
s = -1;
|
||||||
|
memset(&outpackhdr[0], 0, sizeof(outpackhdr));
|
||||||
icmp_type = ICMP_ECHO;
|
icmp_type = ICMP_ECHO;
|
||||||
icmp_type_rsp = ICMP_ECHOREPLY;
|
icmp_type_rsp = ICMP_ECHOREPLY;
|
||||||
phdr_len = 0;
|
phdr_len = 0;
|
||||||
|
nmissedmax = 0;
|
||||||
|
npackets = 0;
|
||||||
|
nreceived = 0;
|
||||||
|
nrepeats = 0;
|
||||||
|
ntransmitted = 0;
|
||||||
|
snpackets = 0;
|
||||||
|
sntransmitted = 0;
|
||||||
|
sweepmax = 0;
|
||||||
sweepmin = 0;
|
sweepmin = 0;
|
||||||
sweepincr = 1;
|
sweepincr = 1;
|
||||||
interval = 1000;
|
interval = 1000;
|
||||||
waittime = MAXWAIT;
|
waittime = MAXWAIT;
|
||||||
nrcvtimeout = 0;
|
nrcvtimeout = 0;
|
||||||
|
timing = 0;
|
||||||
tmin = 999999999.0;
|
tmin = 999999999.0;
|
||||||
tmax = 0.0;
|
tmax = 0.0;
|
||||||
tsum = 0.0;
|
tsum = 0.0;
|
||||||
tsumsq = 0.0;
|
tsumsq = 0.0;
|
||||||
|
finish_up = 0;
|
||||||
|
siginfo_p = 0;
|
||||||
|
|
||||||
exit_code = rtems_bsd_program_call_main("ping", main, argc, argv);
|
exit_code = rtems_bsd_program_call_main("ping", main, argc, argv);
|
||||||
|
|
||||||
rtems_bsd_program_unlock();
|
rtems_bsd_program_unlock();
|
||||||
|
|
||||||
|
close(s);
|
||||||
|
|
||||||
return exit_code;
|
return exit_code;
|
||||||
}
|
}
|
||||||
#endif /* __rtems__ */
|
#endif /* __rtems__ */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user