diff options
Diffstat (limited to 'cddl/contrib/opensolaris/tools/ctf/cvt/util.c')
-rw-r--r-- | cddl/contrib/opensolaris/tools/ctf/cvt/util.c | 63 |
1 files changed, 8 insertions, 55 deletions
diff --git a/cddl/contrib/opensolaris/tools/ctf/cvt/util.c b/cddl/contrib/opensolaris/tools/ctf/cvt/util.c index 0f36fa0..799ca12 100644 --- a/cddl/contrib/opensolaris/tools/ctf/cvt/util.c +++ b/cddl/contrib/opensolaris/tools/ctf/cvt/util.c @@ -43,7 +43,7 @@ #include "ctftools.h" #include "memory.h" -static void (*terminate_cleanup)(void) = NULL; +static void (*terminate_cleanup)() = NULL; /* returns 1 if s1 == s2, 0 otherwise */ int @@ -116,7 +116,7 @@ elf_ptrsz(Elf *elf) /*PRINTFLIKE2*/ static void -whine(const char *type, const char *format, va_list ap) +whine(char *type, char *format, va_list ap) { int error = errno; @@ -128,14 +128,14 @@ whine(const char *type, const char *format, va_list ap) } void -set_terminate_cleanup(void (*cleanup)(void)) +set_terminate_cleanup(void (*cleanup)()) { terminate_cleanup = cleanup; } /*PRINTFLIKE1*/ void -terminate(const char *format, ...) +terminate(char *format, ...) { va_list ap; @@ -148,22 +148,12 @@ terminate(const char *format, ...) if (getenv("CTF_ABORT_ON_TERMINATE") != NULL) abort(); -#if defined(__FreeBSD__) -/* - * For the time being just output the termination message, but don't - * return an exit status that would cause the build to fail. We need - * to get as much stuff built as possible before going back and - * figuring out what is wrong with certain files. - */ - exit(0); -#else exit(1); -#endif } /*PRINTFLIKE1*/ void -aborterr(const char *format, ...) +aborterr(char *format, ...) { va_list ap; @@ -171,16 +161,12 @@ aborterr(const char *format, ...) whine("ERROR", format, ap); va_end(ap); -#if defined(sun) abort(); -#else - exit(0); -#endif } /*PRINTFLIKE1*/ void -warning(const char *format, ...) +warning(char *format, ...) { va_list ap; @@ -194,7 +180,7 @@ warning(const char *format, ...) /*PRINTFLIKE2*/ void -vadebug(int level, const char *format, va_list ap) +vadebug(int level, char *format, va_list ap) { if (level > debug_level) return; @@ -206,7 +192,7 @@ vadebug(int level, const char *format, va_list ap) /*PRINTFLIKE2*/ void -debug(int level, const char *format, ...) +debug(int level, char *format, ...) { va_list ap; @@ -248,36 +234,3 @@ tdesc_name(tdesc_t *tdp) { return (tdp->t_name == NULL ? "(anon)" : tdp->t_name); } - -char *watch_address = NULL; -int watch_length = 0; - -void -watch_set(void *addr, int len) -{ - watch_address = addr; - watch_length = len; -} - -void -watch_dump(int v) -{ - char *p = watch_address; - int i; - - if (watch_address == NULL || watch_length == 0) - return; - - printf("%d: watch %p len %d\n",v,watch_address,watch_length); - for (i = 0; i < watch_length; i++) { - if (*p >= 0x20 && *p < 0x7f) { - printf(" %c",*p++ & 0xff); - } else { - printf(" %02x",*p++ & 0xff); - } - } - printf("\n"); - -} - - |