diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-01-29 22:35:53 +0000 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-01-29 22:35:53 +0000 |
| commit | 24162978b7218b3e4833af14f043862aba35f7c2 (patch) | |
| tree | f75b297f5aa8135bd01fe0dbcbccb77871076346 /contrib/miscutil/misc_utils.c | |
| parent | 1263d7b8d15e885f4806114d5bc701d1ef920ebe (diff) | |
Make sure contrib C functions are marked strict where needed.
Kris Jurka
Diffstat (limited to 'contrib/miscutil/misc_utils.c')
| -rw-r--r-- | contrib/miscutil/misc_utils.c | 19 |
1 files changed, 7 insertions, 12 deletions
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 <unistd.h> #include <signal.h> -#include <string.h> #include <errno.h> #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); |
