#ifndef _COMMON_H_
#define _COMMON_H_
-#include <error.h>
+#include <err.h>
extern char *childobj;
#define ERROR(format, ...) \
- error(1, 0, "ERROR: %s: %s: %d: " format, childobj, __FUNCTION__, __LINE__, ##__VA_ARGS__)
+({ \
+ fflush(stdout); \
+ errx(1, "ERROR: %s: %s: %d: " format, childobj, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
+})
#define DIFF_FATAL(format, ...) \
({ \
fflush(stdout); \
fprintf(stderr, "ERROR: %s: " format "\n", childobj, ##__VA_ARGS__); \
- error(2, 0, "unreconcilable difference"); \
+ errx(2, "unreconcilable difference"); \
})
#define log_debug(format, ...) log(DEBUG, format, ##__VA_ARGS__)
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include <error.h>
+#include <err.h>
#include <gelf.h>
#include <unistd.h>
#include "lookup.h"
#define ERROR(format, ...) \
- error(1, 0, "%s: %d: " format, __FUNCTION__, __LINE__, ##__VA_ARGS__)
+({ \
+ fflush(stdout); \
+ errx(1, "%s: %d: " format, __FUNCTION__, __LINE__, ##__VA_ARGS__); \
+})
struct symbol {
unsigned long value;