=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/ssh/log.c,v retrieving revision 1.18.2.1 retrieving revision 1.18.2.2 diff -u -r1.18.2.1 -r1.18.2.2 --- src/usr.bin/ssh/log.c 2002/03/07 17:37:46 1.18.2.1 +++ src/usr.bin/ssh/log.c 2002/10/11 14:53:06 1.18.2.2 @@ -34,7 +34,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: log.c,v 1.18.2.1 2002/03/07 17:37:46 jason Exp $"); +RCSID("$OpenBSD: log.c,v 1.18.2.2 2002/10/11 14:53:06 miod Exp $"); #include "log.h" #include "xmalloc.h" @@ -89,6 +89,7 @@ log_facility_number(char *name) { int i; + if (name != NULL) for (i = 0; log_facilities[i].name; i++) if (strcasecmp(log_facilities[i].name, name) == 0) @@ -100,6 +101,7 @@ log_level_number(char *name) { int i; + if (name != NULL) for (i = 0; log_levels[i].name; i++) if (strcasecmp(log_levels[i].name, name) == 0) @@ -113,6 +115,7 @@ error(const char *fmt,...) { va_list args; + va_start(args, fmt); do_log(SYSLOG_LEVEL_ERROR, fmt, args); va_end(args); @@ -124,6 +127,7 @@ log(const char *fmt,...) { va_list args; + va_start(args, fmt); do_log(SYSLOG_LEVEL_INFO, fmt, args); va_end(args); @@ -135,6 +139,7 @@ verbose(const char *fmt,...) { va_list args; + va_start(args, fmt); do_log(SYSLOG_LEVEL_VERBOSE, fmt, args); va_end(args); @@ -146,6 +151,7 @@ debug(const char *fmt,...) { va_list args; + va_start(args, fmt); do_log(SYSLOG_LEVEL_DEBUG1, fmt, args); va_end(args); @@ -155,6 +161,7 @@ debug2(const char *fmt,...) { va_list args; + va_start(args, fmt); do_log(SYSLOG_LEVEL_DEBUG2, fmt, args); va_end(args); @@ -164,6 +171,7 @@ debug3(const char *fmt,...) { va_list args; + va_start(args, fmt); do_log(SYSLOG_LEVEL_DEBUG3, fmt, args); va_end(args); @@ -210,6 +218,18 @@ } fatal("fatal_remove_cleanup: no such cleanup function: 0x%lx 0x%lx", (u_long) proc, (u_long) context); +} + +/* Remove all cleanups, to be called after fork() */ +void +fatal_remove_all_cleanups(void) +{ + struct fatal_cleanup *cu, *next_cu; + + for (cu = fatal_cleanups; cu; cu = next_cu) { + next_cu = cu->next; + xfree(cu); + } } /* Cleanup and exit */