Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
27459b41
Commit
27459b41
authored
Jan 23, 2024
by
Vicențiu Ciorbaru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-14448: Ctrl-C should not exit client
Undo any Windows behaviour changes.
parent
15bd7e0b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
32 deletions
+4
-32
client/mysql.cc
client/mysql.cc
+4
-32
No files found.
client/mysql.cc
View file @
27459b41
...
...
@@ -89,7 +89,6 @@ extern "C" {
#undef bcmp // Fix problem with new readline
#if defined(__WIN__)
#include <conio.h>
#include <windows.h>
#else
# ifdef __APPLE__
# include <editline/readline.h>
...
...
@@ -1079,29 +1078,6 @@ static sig_handler window_resize(int sig);
static
void
end_in_sig_handler
(
int
sig
);
static
bool
kill_query
(
const
char
*
reason
);
#ifdef _WIN32
static
BOOL
WINAPI
ctrl_handler_windows
(
DWORD
fdwCtrlType
)
{
switch
(
fdwCtrlType
)
{
// Handle the CTRL-C signal.
case
CTRL_C_EVENT
:
case
CTRL_BREAK_EVENT
:
handle_sigint
(
SIGINT
);
return
TRUE
;
// this means that the signal is handled
case
CTRL_CLOSE_EVENT
:
case
CTRL_LOGOFF_EVENT
:
case
CTRL_SHUTDOWN_EVENT
:
kill_query
(
"Terminate"
);
end_in_sig_handler
(
SIGINT
+
1
);
aborted
=
1
;
}
// This means to pass the signal to the next handler. This allows
// my_cgets and the internal ReadConsole call to exit and gracefully
// abort the program.
return
FALSE
;
}
#endif
const
char
DELIMITER_NAME
[]
=
"delimiter"
;
const
uint
DELIMITER_NAME_LEN
=
sizeof
(
DELIMITER_NAME
)
-
1
;
inline
bool
is_delimiter_command
(
char
*
name
,
ulong
len
)
...
...
@@ -1234,12 +1210,11 @@ int main(int argc,char *argv[])
if
(
!
status
.
batch
)
ignore_errors
=
1
;
// Don't abort monitor
#ifndef _WIN32
signal
(
SIGINT
,
handle_sigint
);
// Catch SIGINT to clean up
if
(
opt_sigint_ignore
)
signal
(
SIGINT
,
SIG_IGN
);
else
signal
(
SIGINT
,
handle_sigint
);
// Catch SIGINT to clean up
signal
(
SIGQUIT
,
mysql_end
);
// Catch SIGQUIT to clean up
#else
SetConsoleCtrlHandler
(
ctrl_handler_windows
,
TRUE
);
#endif
#if defined(HAVE_TERMIOS_H) && defined(GWINSZ_IN_SYS_IOCTL)
/* Readline will call this if it installs a handler */
...
...
@@ -1471,9 +1446,6 @@ bool kill_query(const char *reason)
*/
sig_handler
handle_sigint
(
int
sig
)
{
if
(
opt_sigint_ignore
)
return
;
/*
On Unix only, if no query is being executed just clear the prompt,
don't exit. On Windows we exit.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment