Refactor to share err/warn log API between daemon and client code

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2022-09-05 09:57:45 +02:00
parent 10437887fc
commit 37e3be9a0d
10 changed files with 53 additions and 32 deletions
-13
View File
@@ -28,7 +28,6 @@
#ifdef HAVE_TERMIOS_H
#include <poll.h>
#include <stdio.h>
#include <stdarg.h>
#include <sys/reboot.h>
#include <termios.h>
#endif
@@ -87,18 +86,6 @@ int ttcooked (void);
#define ttcooked() 0
#endif
static __attribute__ ((format (printf, 1, 2))) inline void dbg(char *fmt, ...)
{
va_list ap;
if (!debug)
return;
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
}
static inline char *strterm(char *str, size_t len)
{
str[len - 1] = 0;