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
78485176
Unverified
Commit
78485176
authored
Jan 12, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tools: move lxc-checkpoint to API symbols only
Closes #2073. Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
6a342cab
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
8 deletions
+23
-8
lxc_checkpoint.c
src/lxc/tools/lxc_checkpoint.c
+4
-8
tool_utils.c
src/lxc/tools/tool_utils.c
+18
-0
tool_utils.h
src/lxc/tools/tool_utils.h
+1
-0
No files found.
src/lxc/tools/lxc_checkpoint.c
View file @
78485176
/*
/*
*
* Copyright © 2014 Tycho Andersen <tycho.andersen@canonical.com>.
* Copyright © 2014 Tycho Andersen <tycho.andersen@canonical.com>.
* Copyright © 2014 Canonical Ltd.
* Copyright © 2014 Canonical Ltd.
*
*
...
@@ -17,19 +16,18 @@
...
@@ -17,19 +16,18 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
*/
#
include <stdio.h>
#
define _GNU_SOURCE
#include <errno.h>
#include <errno.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/wait.h>
#include <lxc/lxccontainer.h>
#include <lxc/lxccontainer.h>
#include "log.h"
#include "config.h"
#include "lxc.h"
#include "arguments.h"
#include "arguments.h"
#include "utils.h"
#include "
tool_
utils.h"
static
char
*
checkpoint_dir
=
NULL
;
static
char
*
checkpoint_dir
=
NULL
;
static
bool
stop
=
false
;
static
bool
stop
=
false
;
...
@@ -253,8 +251,6 @@ int main(int argc, char *argv[])
...
@@ -253,8 +251,6 @@ int main(int argc, char *argv[])
if
(
lxc_log_init
(
&
log
))
if
(
lxc_log_init
(
&
log
))
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
lxc_log_options_no_override
();
/* REMOVE IN LXC 3.0 */
/* REMOVE IN LXC 3.0 */
setenv
(
"LXC_UPDATE_CONFIG_FORMAT"
,
"1"
,
0
);
setenv
(
"LXC_UPDATE_CONFIG_FORMAT"
,
"1"
,
0
);
...
...
src/lxc/tools/tool_utils.c
View file @
78485176
...
@@ -276,6 +276,24 @@ out:
...
@@ -276,6 +276,24 @@ out:
#endif
#endif
int
wait_for_pid
(
pid_t
pid
)
{
int
status
,
ret
;
again:
ret
=
waitpid
(
pid
,
&
status
,
0
);
if
(
ret
==
-
1
)
{
if
(
errno
==
EINTR
)
goto
again
;
return
-
1
;
}
if
(
ret
!=
pid
)
goto
again
;
if
(
!
WIFEXITED
(
status
)
||
WEXITSTATUS
(
status
)
!=
0
)
return
-
1
;
return
0
;
}
int
lxc_wait_for_pid_status
(
pid_t
pid
)
int
lxc_wait_for_pid_status
(
pid_t
pid
)
{
{
int
status
,
ret
;
int
status
,
ret
;
...
...
src/lxc/tools/tool_utils.h
View file @
78485176
...
@@ -123,6 +123,7 @@ static inline int lxc_caps_init(void) {
...
@@ -123,6 +123,7 @@ static inline int lxc_caps_init(void) {
}
}
#endif
#endif
extern
int
wait_for_pid
(
pid_t
pid
);
extern
int
lxc_wait_for_pid_status
(
pid_t
pid
);
extern
int
lxc_wait_for_pid_status
(
pid_t
pid
);
extern
int
lxc_safe_int
(
const
char
*
numstr
,
int
*
converted
);
extern
int
lxc_safe_int
(
const
char
*
numstr
,
int
*
converted
);
extern
int
lxc_safe_long
(
const
char
*
numstr
,
long
int
*
converted
);
extern
int
lxc_safe_long
(
const
char
*
numstr
,
long
int
*
converted
);
...
...
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