From 03e9f2891d17643e603f3fd5f88dc61556e38802 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Thu, 12 Mar 2015 14:02:39 +0100 Subject: move edie, die and dbg functions to log.c So it can be reused by the handler. --- nldev.c | 44 ++------------------------------------------ 1 file changed, 2 insertions(+), 42 deletions(-) (limited to 'nldev.c') diff --git a/nldev.c b/nldev.c index 72c9656..eab53ff 100644 --- a/nldev.c +++ b/nldev.c @@ -22,51 +22,11 @@ #include #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) -- cgit v1.2.3