Skip to content

Commit 0c659ed

Browse files
committed
Fix compile errors on Linux.
1 parent 574b6dc commit 0c659ed

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

bin/pgut/pgut.c

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static void init_cancel_handler(void);
2929
static void on_before_exec(PGconn *conn);
3030
static void on_after_exec(void);
3131
static void on_interrupt(void);
32-
static void on_exit(void);
32+
static void on_cleanup(void);
3333
static void exit_or_abort(int exitcode);
3434
const char *get_user_name(const char *progname);
3535

@@ -150,7 +150,7 @@ pgut_getopt(int argc, char **argv)
150150
}
151151

152152
init_cancel_handler();
153-
atexit(on_exit);
153+
atexit(on_cleanup);
154154

155155
(void) (dbname ||
156156
(dbname = getenv("PGDATABASE")) ||
@@ -189,7 +189,12 @@ reconnect(void)
189189
}
190190

191191
if (PQstatus(conn) == CONNECTION_BAD &&
192+
#if PG_VERSION_NUM >= 80300
192193
PQconnectionNeedsPassword(conn) &&
194+
#else
195+
strcmp(PQerrorMessage(conn), PQnoPasswordSupplied) == 0 &&
196+
!feof(stdin) &&
197+
#endif
193198
pwd == NULL)
194199
{
195200
PQfinish(conn);
@@ -360,7 +365,7 @@ on_interrupt(void)
360365
static pqbool in_cleanup = false;
361366

362367
static void
363-
on_exit(void)
368+
on_cleanup(void)
364369
{
365370
in_cleanup = true;
366371
pgut_cleanup(false);

lib/reorg.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
*/
1010

1111
#include "postgres.h"
12+
13+
#include <unistd.h>
14+
1215
#include "access/transam.h"
1316
#include "access/xact.h"
1417
#include "catalog/dependency.h"

0 commit comments

Comments
 (0)