Skip to content

Commit 590a260

Browse files
committed
add sshlog() replacement to sk-dummy.so
1 parent 57e347b commit 590a260

File tree

1 file changed

+25
-7
lines changed

1 file changed

+25
-7
lines changed

regress/misc/sk-dummy/fatal.c

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,36 @@
1010
#include "log.h"
1111

1212
void
13-
sshfatal(const char *file, const char *func, int line, int showfunc,
14-
LogLevel level, const char *suffix, const char *fmt, ...)
13+
sshlogv(const char *file, const char *func, int line, int showfunc,
14+
LogLevel level, const char *suffix, const char *fmt, va_list args)
1515
{
16-
va_list ap;
17-
1816
if (showfunc)
1917
fprintf(stderr, "%s: ", func);
20-
va_start(ap, fmt);
21-
vfprintf(stderr, fmt, ap);
22-
va_end(ap);
18+
vfprintf(stderr, fmt, args);
2319
if (suffix != NULL)
2420
fprintf(stderr, ": %s", suffix);
2521
fputc('\n', stderr);
22+
}
23+
24+
void
25+
sshlog(const char *file, const char *func, int line, int showfunc,
26+
LogLevel level, const char *suffix, const char *fmt, ...)
27+
{
28+
va_list args;
29+
30+
va_start(args, fmt);
31+
sshlogv(file, func, line, showfunc, level, suffix, fmt, args);
32+
va_end(args);
33+
}
34+
35+
void
36+
sshfatal(const char *file, const char *func, int line, int showfunc,
37+
LogLevel level, const char *suffix, const char *fmt, ...)
38+
{
39+
va_list args;
40+
41+
va_start(args, fmt);
42+
sshlogv(file, func, line, showfunc, level, suffix, fmt, args);
43+
va_end(args);
2644
_exit(1);
2745
}

0 commit comments

Comments
 (0)