Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 93a9cc8

Browse files
committed
Invoke on_exit() with correct number and type of arguments.
1 parent a8d4741 commit 93a9cc8

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

src/bin/psql/input.c

+14-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/input.c,v 1.16 2001/02/27 08:13:27 ishii Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/input.c,v 1.17 2001/09/11 23:08:07 petere Exp $
77
*/
88
#include "postgres_fe.h"
99
#include "input.h"
@@ -26,6 +26,13 @@ static bool useHistory;
2626

2727
#endif
2828

29+
#ifdef HAVE_ATEXIT
30+
static void finishInput(void);
31+
#else
32+
/* designed for use with on_exit() */
33+
static void finishInput(int, void*);
34+
#endif
35+
2936

3037
/*
3138
* gets_interactive()
@@ -154,7 +161,7 @@ initializeInput(int flags)
154161
#ifdef HAVE_ATEXIT
155162
atexit(finishInput);
156163
#else
157-
on_exit(finishInput);
164+
on_exit(finishInput, NULL);
158165
#endif
159166
}
160167

@@ -182,8 +189,12 @@ saveHistory(char *fname)
182189

183190

184191

185-
void
192+
static void
193+
#ifdef HAVE_ATEXIT
186194
finishInput(void)
195+
#else
196+
finishInput(int exitstatus, void *arg)
197+
#endif
187198
{
188199
#ifdef USE_HISTORY
189200
if (useHistory)

src/bin/psql/input.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/input.h,v 1.11 2000/10/03 19:50:20 petere Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/input.h,v 1.12 2001/09/11 23:08:07 petere Exp $
77
*/
88
#ifndef INPUT_H
99
#define INPUT_H
@@ -39,6 +39,5 @@ char *gets_fromFile(FILE *source);
3939

4040
void initializeInput(int flags);
4141
bool saveHistory(char *fname);
42-
void finishInput(void);
4342

4443
#endif /* INPUT_H */

0 commit comments

Comments
 (0)