diff options
| author | Pietro Gagliardi <[email protected]> | 2014-08-25 21:17:09 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-08-25 21:17:09 -0400 |
| commit | 35dcac92d644c5ec03b9e4b2f01debec05f99e1c (patch) | |
| tree | 1db165cdfc5170fa05abdd8dd0244b38d73c4d6d /redo/modalqueue.c | |
| parent | a952cfcc58e7657daa2f4e6861b257ab06d8e8c6 (diff) | |
Improved modalqueue.c error handling. A bit dirty to have the same function in multiple Go files like this, but meh.
Diffstat (limited to 'redo/modalqueue.c')
| -rw-r--r-- | redo/modalqueue.c | 6 |
1 files changed, 4 insertions, 2 deletions
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 <stdlib.h> +#include <string.h> +#include <errno.h> #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; } |
