[PATCH] Prevent hanging on unreachable hosts on startup
От | Ryan P. Kelly |
---|---|
Тема | [PATCH] Prevent hanging on unreachable hosts on startup |
Дата | |
Msg-id | 20120105011730.GA26760@llserver.lakeliving.com обсуждение исходный текст |
Ответы |
Re: [PATCH] Prevent hanging on unreachable hosts on startup
|
Список | pgsql-bugs |
The signal handler installed by setup_cancel_handler() will ignore attempts to exit psql should a host be unreachable. Since the functionality it provides won't be used until later, it doesn't make sense to set it up so early. Therefore, move the signal handler closer to where it is first needed. --- src/bin/psql/startup.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/bin/psql/startup.c b/src/bin/psql/startup.c index 8b1864c..e53d84c 100644 --- a/src/bin/psql/startup.c +++ b/src/bin/psql/startup.c @@ -111,8 +111,6 @@ main(int argc, char *argv[]) setvbuf(stderr, NULL, _IONBF, 0); #endif - setup_cancel_handler(); - pset.progname = get_progname(argv[0]); pset.db = NULL; @@ -245,8 +243,9 @@ main(int argc, char *argv[]) } /* - * Now find something to do + * Now find something to do (and handle cancellation, if applicable) */ + setup_cancel_handler(); /* * process file given by -f -- 1.7.7.4
В списке pgsql-bugs по дате отправления: