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
06efeb5c
Commit
06efeb5c
authored
Sep 04, 2008
by
dlezcano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Headers cleanup
parent
f291d61b
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
19 additions
and
46 deletions
+19
-46
create.c
src/lxc/create.c
+0
-4
destroy.c
src/lxc/destroy.c
+1
-7
execute.c
src/lxc/execute.c
+0
-3
freezer.c
src/lxc/freezer.c
+6
-10
kill.c
src/lxc/kill.c
+8
-9
start.c
src/lxc/start.c
+0
-4
stop.c
src/lxc/stop.c
+4
-9
No files found.
src/lxc/create.c
View file @
06efeb5c
...
...
@@ -27,12 +27,8 @@
#include <unistd.h>
#include <errno.h>
#include <sys/param.h>
#include <sys/inotify.h>
#include <sys/file.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <net/if.h>
#include <lxc.h>
...
...
src/lxc/destroy.c
View file @
06efeb5c
...
...
@@ -21,9 +21,6 @@
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define _GNU_SOURCE
#include <stdio.h>
#undef _GNU_SOURCE
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
...
...
@@ -31,12 +28,9 @@
#include <unistd.h>
#include <errno.h>
#include <sys/param.h>
#include <sys/inotify.h>
#include <sys/file.h>
#include <netinet/in.h>
#include <net/if.h>
#include <lxc.h>
#include "monitor.h"
static
int
dir_filter
(
const
struct
dirent
*
dirent
)
{
...
...
src/lxc/execute.c
View file @
06efeb5c
...
...
@@ -30,14 +30,11 @@
#include <signal.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <sys/prctl.h>
#include <sys/wait.h>
#include <sys/file.h>
#include <sys/mount.h>
#include <netinet/in.h>
#include <net/if.h>
#include <lxc.h>
...
...
src/lxc/freezer.c
View file @
06efeb5c
...
...
@@ -29,34 +29,30 @@
#include <string.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <sys/inotify.h>
#include <netinet/in.h>
#include <net/if.h>
#include <lxc.h>
static
int
freeze_unfreeze
(
const
char
*
name
,
int
freeze
)
{
char
*
freezer
,
*
f
=
freeze
?
"FROZEN"
:
"RUNNING"
;
char
freezer
[
MAXPATHLEN
]
,
*
f
=
freeze
?
"FROZEN"
:
"RUNNING"
;
int
fd
,
ret
=
-
1
;
asprintf
(
&
freezer
,
LXCPATH
"/%s/nsgroup/freezer.state"
,
name
);
snprintf
(
freezer
,
MAXPATHLEN
,
LXCPATH
"/%s/nsgroup/freezer.state"
,
name
);
fd
=
open
(
freezer
,
O_WRONLY
);
if
(
fd
<
0
)
{
lxc_log_syserror
(
"failed to open freezer for '%s'"
,
name
);
goto
out
;
return
-
1
;
}
ret
=
write
(
fd
,
f
,
strlen
(
f
)
+
1
)
<
0
;
close
(
fd
);
if
(
ret
)
lxc_log_syserror
(
"failed to write to '%s'"
,
freezer
);
out:
free
(
freezer
);
return
ret
;
return
0
;
}
int
lxc_freeze
(
const
char
*
name
)
...
...
src/lxc/kill.c
View file @
06efeb5c
...
...
@@ -29,26 +29,26 @@
#include <string.h>
#include <signal.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <netinet/in.h>
#include <net/if.h>
#include <lxc.h>
int
lxc_kill
(
const
char
*
name
,
int
signum
)
{
char
*
freezer
=
NULL
,
*
signal
=
NULL
;
char
freezer
[
MAXPATHLEN
]
,
*
signal
=
NULL
;
int
fd
=
-
1
,
ret
=
-
1
;
if
(
signum
<
SIGHUP
||
signum
>
SIGRTMAX
)
{
lxc_log_error
(
"bad signal value %d"
,
signum
);
goto
out
;
return
-
1
;
}
asprintf
(
&
freezer
,
LXCPATH
"/%s/nsgroup/freezer.kill"
,
name
);
asprintf
(
&
signal
,
"%d"
,
signum
);
snprintf
(
freezer
,
MAXPATHLEN
,
LXCPATH
"/%s/nsgroup/freezer.kill"
,
name
);
if
(
!
asprintf
(
&
signal
,
"%d"
,
signum
))
{
lxc_log_syserror
(
"not enough memory"
);
return
-
1
;
}
fd
=
open
(
freezer
,
O_WRONLY
);
if
(
fd
<
0
)
{
...
...
@@ -64,7 +64,6 @@ int lxc_kill(const char *name, int signum)
ret
=
0
;
out:
close
(
fd
);
free
(
freezer
);
free
(
signal
);
return
ret
;
}
src/lxc/start.c
View file @
06efeb5c
...
...
@@ -30,15 +30,11 @@
#include <errno.h>
#include <unistd.h>
#include <signal.h>
#include <mntent.h>
#include <sys/param.h>
#include <sys/file.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/prctl.h>
#include <sys/wait.h>
#include <netinet/in.h>
#include <net/if.h>
#include <lxc.h>
...
...
src/lxc/stop.c
View file @
06efeb5c
...
...
@@ -20,21 +20,16 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define _GNU_SOURCE
#include <stdio.h>
#undef _GNU_SOURCE
#include <fcntl.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <unistd.h>
#include <sys/param.h>
#include <sys/signal.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/param.h>
#include <sys/file.h>
#include <netinet/in.h>
#include <net/if.h>
#include <fcntl.h>
#include <lxc.h>
...
...
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