aboutsummaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorFranklin Wei <git@fwei.tk>2016-02-20 20:37:06 -0500
committerFranklin Wei <git@fwei.tk>2016-02-28 16:30:21 -0500
commit2c687e77cd9ae3fd01010d7b36c8d0082bb76315 (patch)
treeb8cd58cea075a3c94cb2f1417e6eaea27865b827 /src/util.c
parent02de31c48c021742c6245b711790f6d853866c36 (diff)
downloadnetcosm-2c687e77cd9ae3fd01010d7b36c8d0082bb76315.zip
netcosm-2c687e77cd9ae3fd01010d7b36c8d0082bb76315.tar.gz
netcosm-2c687e77cd9ae3fd01010d7b36c8d0082bb76315.tar.bz2
netcosm-2c687e77cd9ae3fd01010d7b36c8d0082bb76315.tar.xz
implements aliases and other assorted features/enhancements
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/util.c b/src/util.c
index cf92dc2..29a5399 100644
--- a/src/util.c
+++ b/src/util.c
@@ -17,7 +17,19 @@
*/
#include "globals.h"
-#include <sys/resource.h>
+
+void __attribute__((noreturn)) error(const char *fmt, ...)
+{
+ char buf[128];
+ memset(buf, 0, sizeof(buf));
+ va_list ap;
+ va_start(ap, fmt);
+ vsnprintf(buf, sizeof(buf), fmt, ap);
+ va_end(ap);
+ perror(buf);
+ abort();
+ exit(EXIT_FAILURE);
+}
void remove_cruft(char *str)
{