Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
8ee3d943
Commit
8ee3d943
authored
Nov 26, 2016
by
Christian Brauner
Committed by
Stéphane Graber
Nov 30, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
monitor: log which pipe fd is currently used
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
4be37478
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
3 deletions
+10
-3
monitor.c
src/lxc/monitor.c
+10
-3
No files found.
src/lxc/monitor.c
View file @
8ee3d943
...
...
@@ -284,11 +284,13 @@ int lxc_monitor_read(int fd, struct lxc_msg *msg)
/* Used to spawn a monitord either on startup of a daemon container, or when
* lxc-monitor starts.
*/
#define __INT_LEN 21
int
lxc_monitord_spawn
(
const
char
*
lxcpath
)
{
pid_t
pid1
,
pid2
;
int
ret
;
int
pipefd
[
2
];
char
pipefd_str
[
11
];
char
pipefd_str
[
__INT_LEN
];
pid_t
pid1
,
pid2
;
char
*
const
args
[]
=
{
LXC_MONITORD_PATH
,
...
...
@@ -308,6 +310,7 @@ int lxc_monitord_spawn(const char *lxcpath)
DEBUG
(
"Going to wait for pid %d."
,
pid1
);
if
(
waitpid
(
pid1
,
NULL
,
0
)
!=
pid1
)
return
-
1
;
DEBUG
(
"Finished waiting on pid %d."
,
pid1
);
return
0
;
}
...
...
@@ -351,7 +354,11 @@ int lxc_monitord_spawn(const char *lxcpath)
close
(
pipefd
[
0
]);
sprintf
(
pipefd_str
,
"%d"
,
pipefd
[
1
]);
ret
=
snprintf
(
pipefd_str
,
__INT_LEN
,
"%d"
,
pipefd
[
1
]);
if
(
ret
<
0
||
ret
>=
__INT_LEN
)
exit
(
EXIT_FAILURE
);
DEBUG
(
"Using pipe file descriptor %d for monitord."
,
pipefd
[
1
]);
execvp
(
args
[
0
],
args
);
...
...
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