From 24162978b7218b3e4833af14f043862aba35f7c2 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sat, 29 Jan 2005 22:35:53 +0000 Subject: Make sure contrib C functions are marked strict where needed. Kris Jurka --- contrib/miscutil/misc_utils.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'contrib/miscutil/misc_utils.c') diff --git a/contrib/miscutil/misc_utils.c b/contrib/miscutil/misc_utils.c index 26bbabe46f7..d6108e3dfff 100644 --- a/contrib/miscutil/misc_utils.c +++ b/contrib/miscutil/misc_utils.c @@ -13,7 +13,6 @@ #include #include -#include #include #include "access/heapam.h" @@ -27,18 +26,14 @@ #include "fmgr.h" #include "storage/lmgr.h" #include "utils/fmgroids.h" -#include "utils/palloc.h" #include "utils/rel.h" #include "utils/tqual.h" #include "misc_utils.h" -#undef MIN -#define MIN(x,y) ((x)<=(y) ? (x) : (y)) - int -backend_pid() +backend_pid(void) { return getpid(); } @@ -51,15 +46,15 @@ unlisten(char *relname) } int -max(int x, int y) +int4max(int x, int y) { - return ((x > y) ? x : y); + return Max(x, y); } int -min(int x, int y) +int4min(int x, int y) { - return ((x < y) ? x : y); + return Min(x, y); } /* @@ -87,7 +82,7 @@ active_listeners(text *relname) if (relname && (VARSIZE(relname) > VARHDRSZ)) { MemSet(listen_name, 0, NAMEDATALEN); - len = MIN(VARSIZE(relname) - VARHDRSZ, NAMEDATALEN - 1); + len = Min(VARSIZE(relname) - VARHDRSZ, NAMEDATALEN - 1); memcpy(listen_name, VARDATA(relname), len); ScanKeyEntryInitialize(&key, 0, Anum_pg_listener_relname, @@ -102,7 +97,7 @@ active_listeners(text *relname) { d = heap_getattr(lTuple, Anum_pg_listener_pid, tdesc, &isnull); pid = DatumGetInt32(d); - if ((pid == ourpid) || (kill(pid, SIGTSTP) == 0)) + if ((pid == ourpid) || (kill(pid, 0) == 0)) count++; } heap_endscan(sRel); -- cgit v1.2.3