If kore_pgsql_query() fails, relay this properly

This commit is contained in:
Joris Vink 2014-04-13 23:43:54 +02:00
parent 3f7e7e696e
commit 4b7a458de6
1 changed files with 7 additions and 1 deletions

View File

@ -46,7 +46,13 @@ char *kore_pgsql_getvalue(struct kore_pgsql *, int, int);
#define KORE_PGSQL(r, q, i, s) \
do { \
if (r->pgsql[i] == NULL) \
kore_pgsql_query(r, q, i); \
if (!kore_pgsql_query(r, q, i)) { \
if (r->pgsql[i] == NULL) \
return (KORE_RESULT_RETRY); \
s; \
r->pgsql[i]->state = \
KORE_PGSQL_STATE_COMPLETE; \
} \
if (r->pgsql[i] == NULL) \
return (KORE_RESULT_RETRY); \
switch (r->pgsql[i]->state) { \