error.c (644B)
1 /************************************************************************* 2 * This file is part of Crosroads 1.23, a load balancer and fail over 3 * utility for TCP. Copyright (c) Karel Kubat, distributed under GPL. 4 * Visit http://crossroads.e-tunity.com for information. 5 *************************************************************************/ 6 #include "crossroads.h" 7 8 void error (char const *fmt, ...) { 9 va_list args; 10 char *str; 11 12 va_start (args, fmt); 13 str = str_vprintf (fmt, args); 14 if (!daemonized) 15 fprintf (stderr, "ERROR: %s\n", str); 16 else 17 writelog (LOG_ERR, "ERROR: %s", str); 18 free (str); 19 exit (1); 20 }