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
d0986340
Unverified
Commit
d0986340
authored
Dec 10, 2019
by
Stéphane Graber
Committed by
GitHub
Dec 10, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3225 from brauner/cgroup_improvements
cgroups/cgfsng: rework legacy cpuset handling
parents
dc3cdf28
8e64b673
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
34 deletions
+16
-34
cgfsng.c
src/lxc/cgroups/cgfsng.c
+0
-0
cgroup.h
src/lxc/cgroups/cgroup.h
+0
-1
file_utils.c
src/lxc/file_utils.c
+1
-0
utils.c
src/lxc/utils.c
+14
-32
utils.h
src/lxc/utils.h
+1
-1
No files found.
src/lxc/cgroups/cgfsng.c
View file @
d0986340
This diff is collapsed.
Click to expand it.
src/lxc/cgroups/cgroup.h
View file @
d0986340
...
...
@@ -14,7 +14,6 @@
#define DEFAULT_MONITOR_CGROUP_PREFIX "lxc.monitor."
#define CGROUP_CREATE_RETRY "-NNNN"
#define CGROUP_CREATE_RETRY_LEN (STRLITERALLEN(CGROUP_CREATE_RETRY))
#define CGROUP_PIVOT "lxc.pivot"
struct
lxc_handler
;
struct
lxc_conf
;
...
...
src/lxc/file_utils.c
View file @
d0986340
...
...
@@ -13,6 +13,7 @@
#include "config.h"
#include "file_utils.h"
#include "log.h"
#include "macro.h"
#include "memory_utils.h"
#include "string_utils.h"
...
...
src/lxc/utils.c
View file @
d0986340
...
...
@@ -1791,21 +1791,19 @@ int fd_cloexec(int fd, bool cloexec)
return
0
;
}
int
recursive_destroy
(
char
*
dirname
)
int
recursive_destroy
(
c
onst
c
har
*
dirname
)
{
__do_closedir
DIR
*
dir
=
NULL
;
int
fret
=
0
;
int
ret
;
struct
dirent
*
direntp
;
DIR
*
dir
;
int
r
=
0
;
dir
=
opendir
(
dirname
);
if
(
!
dir
)
{
SYSERROR
(
"Failed to open dir
\"
%s
\"
"
,
dirname
);
return
-
1
;
}
if
(
!
dir
)
return
log_error_errno
(
-
1
,
errno
,
"Failed to open dir
\"
%s
\"
"
,
dirname
);
while
((
direntp
=
readdir
(
dir
)))
{
char
*
pathname
;
__do_free
char
*
pathname
=
NULL
;
struct
stat
mystat
;
if
(
!
strcmp
(
direntp
->
d_name
,
"."
)
||
...
...
@@ -1813,44 +1811,28 @@ int recursive_destroy(char *dirname)
continue
;
pathname
=
must_make_path
(
dirname
,
direntp
->
d_name
,
NULL
);
ret
=
lstat
(
pathname
,
&
mystat
);
if
(
ret
<
0
)
{
if
(
!
r
)
if
(
!
fret
)
SYSWARN
(
"Failed to stat
\"
%s
\"
"
,
pathname
);
r
=
-
1
;
goto
next
;
fret
=
-
1
;
continue
;
}
if
(
!
S_ISDIR
(
mystat
.
st_mode
))
goto
next
;
continue
;
ret
=
recursive_destroy
(
pathname
);
if
(
ret
<
0
)
r
=
-
1
;
next:
free
(
pathname
);
fret
=
-
1
;
}
ret
=
rmdir
(
dirname
);
if
(
ret
<
0
)
{
if
(
!
r
)
SYSWARN
(
"Failed to delete
\"
%s
\"
"
,
dirname
);
r
=
-
1
;
}
ret
=
closedir
(
dir
);
if
(
ret
<
0
)
{
if
(
!
r
)
SYSWARN
(
"Failed to delete
\"
%s
\"
"
,
dirname
);
r
=
-
1
;
}
if
(
ret
<
0
)
return
log_warn_errno
(
-
1
,
errno
,
"Failed to delete
\"
%s
\"
"
,
dirname
);
return
r
;
return
fret
;
}
int
lxc_setup_keyring
(
void
)
...
...
src/lxc/utils.h
View file @
d0986340
...
...
@@ -231,7 +231,7 @@ extern uint64_t lxc_find_next_power2(uint64_t n);
/* Set a signal the child process will receive after the parent has died. */
extern
int
lxc_set_death_signal
(
int
signal
,
pid_t
parent
,
int
parent_status_fd
);
extern
int
fd_cloexec
(
int
fd
,
bool
cloexec
);
extern
int
recursive_destroy
(
char
*
dirname
);
extern
int
recursive_destroy
(
c
onst
c
har
*
dirname
);
extern
int
lxc_setup_keyring
(
void
);
#endif
/* __LXC_UTILS_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