MCPcopy Create free account
hub / github.com/bloomberg/comdb2 / int_handler

Function int_handler

tools/cdb2sql/cdb2sql.cpp:1985–1998  ·  view source on GitHub ↗

If ctrl_c was pressed to clear existing line and go to new line * If we see two ctrl_c in a row we exit. * However, after a ctrl_c if user typed something * (rl_line_buffer is not empty) and then issue a ctrl_c then dont exit. */

Source from the content-addressed store, hash-verified

1983 * (rl_line_buffer is not empty) and then issue a ctrl_c then dont exit.
1984 */
1985static void int_handler(int signum)
1986{
1987 if (gbl_in_stmt && !gbl_sent_cancel_cnonce)
1988 printf("Requesting to cancel query (press Ctrl-C to exit program). "
1989 "Please wait...\n");
1990 if (gbl_sent_cancel_cnonce) exit(1); // pressed ctrl-c again
1991 if (!gbl_in_stmt) {
1992 rl_crlf();
1993 rl_on_new_line();
1994 rl_replace_line("", 0);
1995 rl_redisplay();
1996 }
1997 send_cancel_cnonce(cdb2_cnonce(cdb2h));
1998}
1999
2000int main(int argc, char *argv[])
2001{

Callers

nothing calls this directly

Calls 3

exitFunction · 0.85
send_cancel_cnonceFunction · 0.85
cdb2_cnonceFunction · 0.85

Tested by

no test coverage detected