Commit 9099e4af authored by Peter Eisentraut's avatar Peter Eisentraut

psql: Set up cancel handler later

The cancel handler was uselessly set up even before the first connection
was opened.  By setting it up afterwards, the user can use Ctrl+C to
abort psql if the initial connection attempt hangs.
Reviewed-by: default avatarDean Rasheed <dean.a.rasheed@gmail.com>
Reviewed-by: default avatarRyan Kelly <rpkelly22@gmail.com>
parent eb5d87e5
...@@ -111,8 +111,6 @@ main(int argc, char *argv[]) ...@@ -111,8 +111,6 @@ main(int argc, char *argv[])
setvbuf(stderr, NULL, _IONBF, 0); setvbuf(stderr, NULL, _IONBF, 0);
#endif #endif
setup_cancel_handler();
pset.progname = get_progname(argv[0]); pset.progname = get_progname(argv[0]);
pset.db = NULL; pset.db = NULL;
...@@ -246,6 +244,8 @@ main(int argc, char *argv[]) ...@@ -246,6 +244,8 @@ main(int argc, char *argv[])
exit(EXIT_BADCONN); exit(EXIT_BADCONN);
} }
setup_cancel_handler();
PQsetNoticeProcessor(pset.db, NoticeProcessor, NULL); PQsetNoticeProcessor(pset.db, NoticeProcessor, NULL);
SyncVariables(); SyncVariables();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment