From 0c659ed31f09418733b6c8db5e89cc0d02768a4c Mon Sep 17 00:00:00 2001 From: Takahiro Itagaki Date: Thu, 23 Apr 2009 06:37:29 +0000 Subject: [PATCH] Fix compile errors on Linux. --- bin/pgut/pgut.c | 11 ++++++++--- lib/reorg.c | 3 +++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/bin/pgut/pgut.c b/bin/pgut/pgut.c index ef02562..c36021a 100755 --- a/bin/pgut/pgut.c +++ b/bin/pgut/pgut.c @@ -29,7 +29,7 @@ static void init_cancel_handler(void); static void on_before_exec(PGconn *conn); static void on_after_exec(void); static void on_interrupt(void); -static void on_exit(void); +static void on_cleanup(void); static void exit_or_abort(int exitcode); const char *get_user_name(const char *progname); @@ -150,7 +150,7 @@ pgut_getopt(int argc, char **argv) } init_cancel_handler(); - atexit(on_exit); + atexit(on_cleanup); (void) (dbname || (dbname = getenv("PGDATABASE")) || @@ -189,7 +189,12 @@ reconnect(void) } if (PQstatus(conn) == CONNECTION_BAD && +#if PG_VERSION_NUM >= 80300 PQconnectionNeedsPassword(conn) && +#else + strcmp(PQerrorMessage(conn), PQnoPasswordSupplied) == 0 && + !feof(stdin) && +#endif pwd == NULL) { PQfinish(conn); @@ -360,7 +365,7 @@ on_interrupt(void) static pqbool in_cleanup = false; static void -on_exit(void) +on_cleanup(void) { in_cleanup = true; pgut_cleanup(false); diff --git a/lib/reorg.c b/lib/reorg.c index b706f8a..81a4c4b 100755 --- a/lib/reorg.c +++ b/lib/reorg.c @@ -9,6 +9,9 @@ */ #include "postgres.h" + +#include + #include "access/transam.h" #include "access/xact.h" #include "catalog/dependency.h"