aboutsummaryrefslogtreecommitdiffstats
path: root/nldev.c
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-03-12 14:02:39 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2015-03-12 14:02:39 +0100
commit03e9f2891d17643e603f3fd5f88dc61556e38802 (patch)
tree6dbdbad916543b0ebb95a4da0bf28d5247a26a78 /nldev.c
parent9ba3489123c6de58f70fc05379644c2ccedbe870 (diff)
downloadnldev-03e9f2891d17643e603f3fd5f88dc61556e38802.tar.bz2
nldev-03e9f2891d17643e603f3fd5f88dc61556e38802.tar.xz
move edie, die and dbg functions to log.c
So it can be reused by the handler.
Diffstat (limited to 'nldev.c')
-rw-r--r--nldev.c44
1 files changed, 2 insertions, 42 deletions
diff --git a/nldev.c b/nldev.c
index 72c9656..eab53ff 100644
--- a/nldev.c
+++ b/nldev.c
@@ -22,51 +22,11 @@
#include <linux/netlink.h>
#include "arg.h"
+#include "log.h"
char *argv0;
int listfd = -1;
-int dofork = 0, dodebug = 0;
-
-void
-edie(char *fmt, ...)
-{
- va_list fmtargs;
-
- va_start(fmtargs, fmt);
- vfprintf(stderr, fmt, fmtargs);
- va_end(fmtargs);
- fprintf(stderr, ": ");
-
- perror(NULL);
-
- exit(1);
-}
-
-void
-die(char *fmt, ...)
-{
- va_list fmtargs;
-
- va_start(fmtargs, fmt);
- vfprintf(stderr, fmt, fmtargs);
- va_end(fmtargs);
-
- exit(1);
-}
-
-void
-dbg(char *fmt, ...)
-{
- va_list fmtargs;
-
- if (dodebug) {
- fprintf(stderr, "%s: ", argv0);
- va_start(fmtargs, fmt);
- vfprintf(stderr, fmt, fmtargs);
- va_end(fmtargs);
- fprintf(stderr, "\n");
- }
-}
+int dofork = 0;
void
disableoom(void)