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
d12ba31c
Commit
d12ba31c
authored
Feb 22, 2007
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge fix.
parent
3645bbe7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
server-tools/instance-manager/angel.cc
server-tools/instance-manager/angel.cc
+8
-7
server-tools/instance-manager/manager.cc
server-tools/instance-manager/manager.cc
+3
-1
No files found.
server-tools/instance-manager/angel.cc
View file @
d12ba31c
...
...
@@ -43,6 +43,7 @@ enum { CHILD_OK= 0, CHILD_NEED_RESPAWN, CHILD_EXIT_ANGEL };
static
int
log_fd
;
static
volatile
sig_atomic_t
child_status
=
CHILD_OK
;
static
volatile
sig_atomic_t
child_exit_code
=
0
;
static
volatile
sig_atomic_t
shutdown_request_signo
=
0
;
...
...
@@ -171,7 +172,7 @@ static bool create_pid_file()
/**
SIGCHLD handler.
Reap child, analyze child exit
status
, and set child_status
Reap child, analyze child exit
code
, and set child_status
appropriately.
*************************************************************************/
...
...
@@ -179,13 +180,12 @@ void reap_child(int __attribute__((unused)) signo)
{
/* NOTE: As we have only one child, no need to cycle waitpid(). */
int
child_exit_status
;
int
exit_code
;
if
(
waitpid
(
0
,
&
child_exit_status
,
WNOHANG
)
>
0
)
if
(
waitpid
(
0
,
&
exit_code
,
WNOHANG
)
>
0
)
{
child_status
=
WIFSIGNALED
(
child_exit_status
)
?
CHILD_NEED_RESPAWN
:
CHILD_EXIT_ANGEL
;
child_exit_code
=
exit_code
;
child_status
=
exit_code
?
CHILD_NEED_RESPAWN
:
CHILD_EXIT_ANGEL
;
}
}
...
...
@@ -312,7 +312,8 @@ static int angel_main_loop()
{
child_status
=
CHILD_OK
;
log_error
(
"Angel: Manager exited abnormally."
);
log_error
(
"Angel: Manager exited abnormally (exit code: %d)."
,
(
int
)
child_exit_code
);
log_info
(
"Angel: sleeping 1 second..."
);
...
...
server-tools/instance-manager/manager.cc
View file @
d12ba31c
...
...
@@ -246,7 +246,8 @@ bool Manager::init_user_map(User_map *user_map)
See also comments in mysqlmanager.cc to picture general Instance Manager
architecture.
TODO: how about returning error status.
RETURNS
main() returns exit status (exit code).
*/
int
Manager
::
main
()
...
...
@@ -452,6 +453,7 @@ int Manager::main()
/* free alarm structures */
end_thr_alarm
(
1
);
#endif
return
thread_registry
.
get_error_status
()
?
1
:
0
;
}
...
...
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