mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-07-22 23:55:34 +08:00
PING(8): Use BSD program lock
This commit is contained in:
parent
58b493bb0c
commit
c4645e4de4
@ -44,6 +44,8 @@ static char sccsid[] = "@(#)ping.c 8.1 (Berkeley) 6/5/93";
|
|||||||
#ifdef __rtems__
|
#ifdef __rtems__
|
||||||
#define __need_getopt_newlib
|
#define __need_getopt_newlib
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
|
#include <machine/rtems-bsd-program.h>
|
||||||
|
#include <machine/rtems-bsd-commands.h>
|
||||||
#endif /* __rtems__ */
|
#endif /* __rtems__ */
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__FBSDID("$FreeBSD$");
|
__FBSDID("$FreeBSD$");
|
||||||
@ -220,13 +222,14 @@ static void tvsub(struct timeval *, struct timeval *);
|
|||||||
static void usage(void) __dead2;
|
static void usage(void) __dead2;
|
||||||
|
|
||||||
#ifdef __rtems__
|
#ifdef __rtems__
|
||||||
#include <machine/rtems-bsd-program.h>
|
|
||||||
#include <machine/rtems-bsd-commands.h>
|
|
||||||
|
|
||||||
static int main(int argc, char **argv);
|
static int main(int argc, char **argv);
|
||||||
|
|
||||||
int rtems_bsd_command_ping(int argc, char *argv[])
|
int rtems_bsd_command_ping(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
int exit_code;
|
||||||
|
|
||||||
|
rtems_bsd_program_lock();
|
||||||
|
|
||||||
BBELL = '\a';
|
BBELL = '\a';
|
||||||
BSPACE = '\b';
|
BSPACE = '\b';
|
||||||
DOT = '.';
|
DOT = '.';
|
||||||
@ -243,7 +246,11 @@ int rtems_bsd_command_ping(int argc, char *argv[])
|
|||||||
tsum = 0.0;
|
tsum = 0.0;
|
||||||
tsumsq = 0.0;
|
tsumsq = 0.0;
|
||||||
|
|
||||||
return rtems_bsd_program_call_main("ping", main, argc, argv);
|
exit_code = rtems_bsd_program_call_main("ping", main, argc, argv);
|
||||||
|
|
||||||
|
rtems_bsd_program_unlock();
|
||||||
|
|
||||||
|
return exit_code;
|
||||||
}
|
}
|
||||||
#endif /* __rtems__ */
|
#endif /* __rtems__ */
|
||||||
int
|
int
|
||||||
|
Loading…
x
Reference in New Issue
Block a user