From 35dcac92d644c5ec03b9e4b2f01debec05f99e1c Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 25 Aug 2014 21:17:09 -0400 Subject: Improved modalqueue.c error handling. A bit dirty to have the same function in multiple Go files like this, but meh. --- redo/modalqueue.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'redo/modalqueue.c') diff --git a/redo/modalqueue.c b/redo/modalqueue.c index 7474c95..a41787f 100644 --- a/redo/modalqueue.c +++ b/redo/modalqueue.c @@ -1,6 +1,8 @@ // 19 august 2014 #include +#include +#include #include "modalqueue.h" static struct { @@ -17,7 +19,7 @@ void beginModal(void) mq.cap = 128; mq.queue = (void **) malloc(mq.cap * sizeof (void *)); if (mq.queue == NULL) - abort();//TODO + modalPanic("error allocating modal queue", strerror(errno)); mq.len = 0; } } @@ -42,7 +44,7 @@ int queueIfModal(void *what) mq.cap *= 2; mq.queue = (void **) realloc(mq.queue, mq.cap * sizeof (void *)); if (mq.queue == NULL) - abort();//TODO + modalPanic("error growing modal queue", strerror(errno)); } return 1; } -- cgit v1.2.3