|
@@ -12,6 +12,7 @@
|
|
|
|
|
|
|
|
#include "config.h"
|
|
#include "config.h"
|
|
|
|
|
|
|
|
|
|
+#include <errno.h>
|
|
|
#include <stdbool.h>
|
|
#include <stdbool.h>
|
|
|
#include <stdio.h>
|
|
#include <stdio.h>
|
|
|
#include <stdarg.h>
|
|
#include <stdarg.h>
|
|
@@ -28,6 +29,8 @@ enum {
|
|
|
};
|
|
};
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
|
|
+#include "util.h"
|
|
|
|
|
+
|
|
|
/* debug flags */
|
|
/* debug flags */
|
|
|
extern bool opt_debug;
|
|
extern bool opt_debug;
|
|
|
extern bool opt_debug_console;
|
|
extern bool opt_debug_console;
|
|
@@ -58,6 +61,16 @@ extern void _applog(int prio, const char *str);
|
|
|
return rv; \
|
|
return rv; \
|
|
|
} while (0)
|
|
} while (0)
|
|
|
|
|
|
|
|
|
|
+#define appperror(prio, s) do { \
|
|
|
|
|
+ const char *_tmp43 = bfg_strerror(errno, BST_ERRNO); \
|
|
|
|
|
+ if (s && s[0]) \
|
|
|
|
|
+ applog(prio, "%s: %s", s, _tmp43); \
|
|
|
|
|
+ else \
|
|
|
|
|
+ _applog(prio, _tmp43); \
|
|
|
|
|
+} while (0)
|
|
|
|
|
+
|
|
|
|
|
+#define perror(s) appperror(LOG_ERR, s)
|
|
|
|
|
+
|
|
|
extern void _bfg_clean_up(void);
|
|
extern void _bfg_clean_up(void);
|
|
|
|
|
|
|
|
#define quit(status, fmt, ...) do { \
|
|
#define quit(status, fmt, ...) do { \
|