From b851111d869938c6ca5872642863b61076f34f35 Mon Sep 17 00:00:00 2001 From: Marko Kreen Date: Tue, 18 Dec 2007 16:19:09 +0000 Subject: [PATCH] make plproxy_error survive NULL, also avoid NULL func if possible --- src/execute.c | 2 +- src/main.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/execute.c b/src/execute.c index 592f07f..31f4813 100644 --- a/src/execute.c +++ b/src/execute.c @@ -237,7 +237,7 @@ intr_loop: { if (errno == EINTR) goto intr_loop; - plproxy_error(NULL, "check_old_conn: select failed: %s", + plproxy_error(func, "check_old_conn: select failed: %s", strerror(errno)); } diff --git a/src/main.c b/src/main.c index 0b92ee0..fdeb99c 100644 --- a/src/main.c +++ b/src/main.c @@ -75,8 +75,11 @@ plproxy_error(ProxyFunction *func, const char *fmt,...) plproxy_clean_results(func->cur_cluster); - elog(ERROR, "PL/Proxy function %s(%d): %s", - func->name, func->arg_count, msg); + if (func) + elog(ERROR, "PL/Proxy function %s(%d): %s", + func->name, func->arg_count, msg); + else + elog(ERROR, "PL/Proxy error: %s", msg); } /* -- 2.39.5