From 2222164c278454aa2c3621f09093aa76bbefe271 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sun, 16 Sep 2007 22:51:28 +0200 Subject: [PATCH] add a die() function to util --- util.c | 11 +++++++++++ util.h | 1 + 2 files changed, 12 insertions(+) diff --git a/util.c b/util.c index 5230dbe82..3c00b2e09 100644 --- a/util.c +++ b/util.c @@ -30,6 +30,17 @@ #include "util.h" +void +die(const char *fmt, ...) +{ + va_list ap; + + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + abort(); +} + void eprint(const char *fmt, ...) { diff --git a/util.h b/util.h index 7bdc03446..736943c85 100644 --- a/util.h +++ b/util.h @@ -118,6 +118,7 @@ static inline char *a_strdup(const char *s) return len ? p_dup(s, len + 1) : NULL; } +void die(const char *, ...) __attribute__ ((noreturn)) __attribute__ ((format(printf, 1, 2))); void eprint(const char *, ...) __attribute__ ((noreturn)) __attribute__ ((format(printf, 1, 2))); void uicb_spawn(Display *, int, DC *, awesome_config *, const char *); Bool xgettextprop(Display *, Window, Atom, char *, unsigned int);