Commit e7d1d8b3 authored by Niels Möller's avatar Niels Möller
Browse files

* werror.c (_fatal): New function.

Rev: src/sftp/werror.c:1.2
Rev: src/sftp/werror.h:1.2
parent 77b4e84a
......@@ -11,6 +11,8 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
void
werror(const char *format, ...)
{
......@@ -38,3 +40,18 @@ fatal(const char *format, ...)
exit(EXIT_FAILURE);
}
void
_fatal(const char *format, ...)
{
va_list args;
va_start(args, format);
fprintf(stderr, "%s: ", werror_program_name);
vfprintf(stderr, format, args);
va_end(args);
_exit(EXIT_FAILURE);
}
......@@ -15,6 +15,7 @@ extern const char *werror_program_name;
void werror(const char *format, ...) PRINTF_STYLE(1,2);
void fatal(const char *format, ...) PRINTF_STYLE(1,2) NORETURN;
void _fatal(const char *format, ...) PRINTF_STYLE(1,2) NORETURN;
#endif /* SFTP_WERROR_H_INCLUDED */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment