diff --git a/src/bin/psql/input.c b/src/bin/psql/input.c
index 894fc8d454745634927da56b88cb44ae8ca23fa9..17cfee41aeb2ee87d35555b247d0eb846391b5d8 100644
--- a/src/bin/psql/input.c
+++ b/src/bin/psql/input.c
@@ -3,7 +3,7 @@
  *
  * Copyright 2000 by PostgreSQL Global Development Group
  *
- * $Header: /cvsroot/pgsql/src/bin/psql/input.c,v 1.16 2001/02/27 08:13:27 ishii Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/input.c,v 1.17 2001/09/11 23:08:07 petere Exp $
  */
 #include "postgres_fe.h"
 #include "input.h"
@@ -26,6 +26,13 @@ static bool useHistory;
 
 #endif
 
+#ifdef HAVE_ATEXIT
+static void	finishInput(void);
+#else
+/* designed for use with on_exit() */
+static void	finishInput(int, void*);
+#endif
+
 
 /*
  * gets_interactive()
@@ -154,7 +161,7 @@ initializeInput(int flags)
 #ifdef HAVE_ATEXIT
 	atexit(finishInput);
 #else
-	on_exit(finishInput);
+	on_exit(finishInput, NULL);
 #endif
 }
 
@@ -182,8 +189,12 @@ saveHistory(char *fname)
 
 
 
-void
+static void
+#ifdef HAVE_ATEXIT
 finishInput(void)
+#else
+finishInput(int exitstatus, void *arg)
+#endif
 {
 #ifdef USE_HISTORY
 	if (useHistory)
diff --git a/src/bin/psql/input.h b/src/bin/psql/input.h
index 69387989faaf361c2edeb371f41c1ef8e22fca3b..ff9deade1d977fdad0652e198680935f2e4d5572 100644
--- a/src/bin/psql/input.h
+++ b/src/bin/psql/input.h
@@ -3,7 +3,7 @@
  *
  * Copyright 2000 by PostgreSQL Global Development Group
  *
- * $Header: /cvsroot/pgsql/src/bin/psql/input.h,v 1.11 2000/10/03 19:50:20 petere Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/input.h,v 1.12 2001/09/11 23:08:07 petere Exp $
  */
 #ifndef INPUT_H
 #define INPUT_H
@@ -39,6 +39,5 @@ char	   *gets_fromFile(FILE *source);
 
 void		initializeInput(int flags);
 bool		saveHistory(char *fname);
-void		finishInput(void);
 
 #endif	 /* INPUT_H */