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
abfd666c
Commit
abfd666c
authored
Sep 04, 2008
by
dlezcano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Truncate 'init' file when opening it
parent
25689bbf
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
execute.c
src/liblxc/execute.c
+1
-1
start.c
src/liblxc/start.c
+4
-3
No files found.
src/liblxc/execute.c
View file @
abfd666c
...
...
@@ -198,7 +198,7 @@ int lxc_execute(const char *name, int argc, char *argv[],
}
asprintf
(
&
init
,
LXCPATH
"/%s/init"
,
name
);
fd
=
open
(
init
,
O_WRONLY
|
O_CREAT
,
S_IRUSR
|
S_IWUSR
);
fd
=
open
(
init
,
O_WRONLY
|
O_CREAT
|
O_TRUNC
,
S_IRUSR
|
S_IWUSR
);
if
(
fd
<
0
)
{
lxc_log_syserror
(
"failed to open %s"
,
init
);
goto
err_open
;
...
...
src/liblxc/start.c
View file @
abfd666c
...
...
@@ -139,7 +139,7 @@ int lxc_start(const char *name, int argc, char *argv[],
if
(
write
(
sv
[
0
],
&
sync
,
sizeof
(
sync
))
<
0
)
lxc_log_syserror
(
"failed to write the socket"
);
return
1
;
exit
(
1
)
;
}
close
(
sv
[
0
]);
...
...
@@ -178,7 +178,7 @@ int lxc_start(const char *name, int argc, char *argv[],
asprintf
(
&
val
,
"%d
\n
"
,
pid
);
asprintf
(
&
init
,
LXCPATH
"/%s/init"
,
name
);
fd
=
open
(
init
,
O_WRONLY
|
O_CREAT
,
S_IRUSR
|
S_IWUSR
);
fd
=
open
(
init
,
O_WRONLY
|
O_CREAT
|
O_TRUNC
,
S_IRUSR
|
S_IWUSR
);
if
(
fd
<
0
)
{
lxc_log_syserror
(
"failed to open '%s'"
,
init
);
goto
err_write
;
...
...
@@ -195,7 +195,8 @@ int lxc_start(const char *name, int argc, char *argv[],
lxc_log_warning
(
"cgroupfs not found: cgroup disabled"
);
if
(
lxc_setstate
(
name
,
RUNNING
))
{
lxc_log_error
(
"failed to set state to %s"
,
lxc_state2str
(
RUNNING
));
lxc_log_error
(
"failed to set state to %s"
,
lxc_state2str
(
RUNNING
));
goto
err_state_failed
;
}
...
...
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