diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2015-03-12 14:02:39 +0100 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2015-03-12 14:02:39 +0100 |
commit | 03e9f2891d17643e603f3fd5f88dc61556e38802 (patch) | |
tree | 6dbdbad916543b0ebb95a4da0bf28d5247a26a78 /nldev.c | |
parent | 9ba3489123c6de58f70fc05379644c2ccedbe870 (diff) | |
download | nldev-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.c | 44 |
1 files changed, 2 insertions, 42 deletions
@@ -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) |