diff options
author | Chris Johns <chrisj@rtems.org> | 2015-06-16 13:16:37 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2015-06-16 13:16:37 +1000 |
commit | b5aca585949aa94d8d254ab4c4e5b4b2f7b1f1d9 (patch) | |
tree | 7159a7f44d3817bd9654046fd68fc6a7894e4424 /rtemsbsd/rtems/rtems-bsd-program.c | |
parent | Fix KVM symbol generator to remove warnings. (diff) | |
download | rtems-libbsd-b5aca585949aa94d8d254ab4c4e5b4b2f7b1f1d9.tar.bz2 |
Add error() to the BSD program support.
Diffstat (limited to 'rtemsbsd/rtems/rtems-bsd-program.c')
-rw-r--r-- | rtemsbsd/rtems/rtems-bsd-program.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/rtemsbsd/rtems/rtems-bsd-program.c b/rtemsbsd/rtems/rtems-bsd-program.c index 8edd8f93..7b5920e2 100644 --- a/rtemsbsd/rtems/rtems-bsd-program.c +++ b/rtemsbsd/rtems/rtems-bsd-program.c @@ -52,6 +52,8 @@ #include <setjmp.h> #include <stdlib.h> +#include <machine/rtems-bsd-program.h> + struct rtems_bsd_program_control { void *context; int exit_code; @@ -116,6 +118,17 @@ rtems_bsd_program_exit(int exit_code) panic("unexpected BSD program exit"); } +void +rtems_bsd_program_error(const char *fmt, ...) +{ + va_list list; + va_start(list, fmt); + vfprintf(stderr, fmt, list); + fprintf(stderr, "\n"); + va_end(list); + rtems_bsd_program_exit(1); +} + const char * rtems_bsd_program_get_name(void) { |