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
2c495ae3
Commit
2c495ae3
authored
Jul 22, 2013
by
Serge Hallyn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgroup_enter: catch write errors
Signed-off-by:
Serge Hallyn
<
serge.hallyn@ubuntu.com
>
Acked-by:
Stéphane Graber
<
stgraber@ubuntu.com
>
parent
d155b47d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
cgroup.c
src/lxc/cgroup.c
+11
-4
No files found.
src/lxc/cgroup.c
View file @
2c495ae3
...
...
@@ -769,16 +769,23 @@ int lxc_cgroup_enter(const char *cgpath, pid_t pid)
ret
=
snprintf
(
path
,
MAXPATHLEN
,
"%s/%s/tasks"
,
mntent_r
.
mnt_dir
,
cgpath
);
if
(
ret
<
0
||
ret
>=
MAXPATHLEN
)
{
ERROR
(
"entering cgroup"
);
ERROR
(
"
Error
entering cgroup"
);
goto
out
;
}
fout
=
fopen
(
path
,
"w"
);
if
(
!
fout
)
{
ERROR
(
"entering cgroup"
);
SYSERROR
(
"Error entering cgroup"
);
goto
out
;
}
if
(
fprintf
(
fout
,
"%d
\n
"
,
(
int
)
pid
)
<
0
)
{
ERROR
(
"Error writing pid to %s"
,
path
);
fclose
(
fout
);
goto
out
;
}
if
(
fclose
(
fout
)
<
0
)
{
SYSERROR
(
"Error writing pid to %s"
,
path
);
goto
out
;
}
fprintf
(
fout
,
"%d
\n
"
,
(
int
)
pid
);
fclose
(
fout
);
}
retv
=
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