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
a17f8b3f
Unverified
Commit
a17f8b3f
authored
Aug 25, 2017
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgfsng: non-functional changes
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
01b2d1f1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
cgfsng.c
src/lxc/cgroups/cgfsng.c
+17
-8
No files found.
src/lxc/cgroups/cgfsng.c
View file @
a17f8b3f
...
@@ -1199,6 +1199,7 @@ out_free:
...
@@ -1199,6 +1199,7 @@ out_free:
static
int
cgroup_rmdir
(
char
*
dirname
)
static
int
cgroup_rmdir
(
char
*
dirname
)
{
{
int
ret
;
struct
dirent
*
direntp
;
struct
dirent
*
direntp
;
DIR
*
dir
;
DIR
*
dir
;
int
r
=
0
;
int
r
=
0
;
...
@@ -1208,8 +1209,8 @@ static int cgroup_rmdir(char *dirname)
...
@@ -1208,8 +1209,8 @@ static int cgroup_rmdir(char *dirname)
return
-
1
;
return
-
1
;
while
((
direntp
=
readdir
(
dir
)))
{
while
((
direntp
=
readdir
(
dir
)))
{
struct
stat
mystat
;
char
*
pathname
;
char
*
pathname
;
struct
stat
mystat
;
if
(
!
direntp
)
if
(
!
direntp
)
break
;
break
;
...
@@ -1220,32 +1221,40 @@ static int cgroup_rmdir(char *dirname)
...
@@ -1220,32 +1221,40 @@ static int cgroup_rmdir(char *dirname)
pathname
=
must_make_path
(
dirname
,
direntp
->
d_name
,
NULL
);
pathname
=
must_make_path
(
dirname
,
direntp
->
d_name
,
NULL
);
if
(
lstat
(
pathname
,
&
mystat
))
{
ret
=
lstat
(
pathname
,
&
mystat
);
if
(
ret
<
0
)
{
if
(
!
r
)
if
(
!
r
)
WARN
(
"
f
ailed to stat %s"
,
pathname
);
WARN
(
"
F
ailed to stat %s"
,
pathname
);
r
=
-
1
;
r
=
-
1
;
goto
next
;
goto
next
;
}
}
if
(
!
S_ISDIR
(
mystat
.
st_mode
))
if
(
!
S_ISDIR
(
mystat
.
st_mode
))
goto
next
;
goto
next
;
if
(
cgroup_rmdir
(
pathname
)
<
0
)
ret
=
cgroup_rmdir
(
pathname
);
if
(
ret
<
0
)
r
=
-
1
;
r
=
-
1
;
next:
next:
free
(
pathname
);
free
(
pathname
);
}
}
if
(
rmdir
(
dirname
)
<
0
)
{
ret
=
rmdir
(
dirname
);
if
(
ret
<
0
)
{
if
(
!
r
)
if
(
!
r
)
WARN
(
"failed to delete %s: %s"
,
dirname
,
strerror
(
errno
));
WARN
(
"Failed to delete
\"
%s
\"
: %s"
,
dirname
,
strerror
(
errno
));
r
=
-
1
;
r
=
-
1
;
}
}
if
(
closedir
(
dir
)
<
0
)
{
ret
=
closedir
(
dir
);
if
(
ret
<
0
)
{
if
(
!
r
)
if
(
!
r
)
WARN
(
"failed to delete %s: %s"
,
dirname
,
strerror
(
errno
));
WARN
(
"Failed to delete
\"
%s
\"
: %s"
,
dirname
,
strerror
(
errno
));
r
=
-
1
;
r
=
-
1
;
}
}
return
r
;
return
r
;
}
}
...
...
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