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
c2858e8b
Commit
c2858e8b
authored
Oct 08, 2008
by
Magnus Svensson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WL#4189 NO need to retry OpenEvent if the process does not exist anymore
parent
870699c9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
1 deletion
+14
-1
mysql-test/lib/My/SafeProcess/safe_kill_win.cc
mysql-test/lib/My/SafeProcess/safe_kill_win.cc
+14
-1
No files found.
mysql-test/lib/My/SafeProcess/safe_kill_win.cc
View file @
c2858e8b
...
@@ -49,12 +49,25 @@ int main(int argc, const char** argv )
...
@@ -49,12 +49,25 @@ int main(int argc, const char** argv )
while
((
shutdown_event
=
while
((
shutdown_event
=
OpenEvent
(
EVENT_MODIFY_STATE
,
FALSE
,
safe_process_name
))
==
NULL
)
OpenEvent
(
EVENT_MODIFY_STATE
,
FALSE
,
safe_process_name
))
==
NULL
)
{
{
/*
Check if the process is alive, otherwise there is really
no idea to retry the open of the event
*/
HANDLE
process
;
if
((
process
=
OpenProcess
(
SYNCHRONIZE
,
FALSE
,
pid
))
==
NULL
)
{
fprintf
(
stderr
,
"Could not open event or process %d, error: %d
\n
"
,
pid
,
GetLastError
());
exit
(
3
);
}
CloseHandle
(
process
);
if
(
retry_open_event
--
)
if
(
retry_open_event
--
)
Sleep
(
100
);
Sleep
(
100
);
else
else
{
{
fprintf
(
stderr
,
"Failed to open shutdown_event '%s', error: %d
\n
"
,
fprintf
(
stderr
,
"Failed to open shutdown_event '%s', error: %d
\n
"
,
safe_process_name
,
GetLastError
());
safe_process_name
,
GetLastError
());
exit
(
3
);
exit
(
3
);
}
}
}
}
...
...
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