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
1274eb5c
Unverified
Commit
1274eb5c
authored
Feb 24, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cgroups: make use of ERRNO_IS_NOT_SUPPORTED()
This will hopefully prevent backwards compatibility fallback errors. Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
0e48c43b
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
attach.c
src/lxc/attach.c
+1
-1
cgfsng.c
src/lxc/cgroups/cgfsng.c
+4
-2
No files found.
src/lxc/attach.c
View file @
1274eb5c
...
...
@@ -1641,7 +1641,7 @@ int lxc_attach(struct lxc_container *container, lxc_attach_exec_t exec_function,
ret
=
cgroup_attach
(
conf
,
name
,
lxcpath
,
pid
);
if
(
ret
)
{
call_cleaner
(
cgroup_exit
)
struct
cgroup_ops
*
cgroup_ops
=
NULL
;
if
(
ret
!=
-
ENOCGROUP2
&&
ret
!=
-
ENOSYS
)
{
if
(
!
ERRNO_IS_NOT_SUPPORTED
(
ret
)
)
{
SYSERROR
(
"Failed to attach cgroup"
);
goto
on_error
;
}
...
...
src/lxc/cgroups/cgfsng.c
View file @
1274eb5c
...
...
@@ -3419,7 +3419,7 @@ static int __cgroup_attach_unified(const struct lxc_conf *conf, const char *name
dfd_unified
=
lxc_cmd_get_cgroup2_fd
(
name
,
lxcpath
);
if
(
dfd_unified
<
0
)
return
ret_errno
(
ENO
CGROUP2
);
return
ret_errno
(
ENO
SYS
);
return
__unified_attach_fd
(
conf
,
dfd_unified
,
pid
);
}
...
...
@@ -3431,10 +3431,12 @@ int cgroup_attach(const struct lxc_conf *conf, const char *name,
ret
=
__cgroup_attach_many
(
conf
,
name
,
lxcpath
,
pid
);
if
(
ret
<
0
)
{
if
(
ret
!=
-
ENOSYS
)
if
(
!
ERRNO_IS_NOT_SUPPORTED
(
ret
)
)
return
ret
;
ret
=
__cgroup_attach_unified
(
conf
,
name
,
lxcpath
,
pid
);
if
(
ret
<
0
&&
ERRNO_IS_NOT_SUPPORTED
(
ret
))
return
ret_errno
(
ENOSYS
);
}
return
ret
;
...
...
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