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
77f626c5
Unverified
Commit
77f626c5
authored
May 04, 2021
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf: tweak setup_personality()
Use the dedicated LXC_ARCH_UNCHANGED macro everywhere instead of relying on -1 being correct. Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
5ae15884
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
+5
-6
conf.c
src/lxc/conf.c
+5
-6
No files found.
src/lxc/conf.c
View file @
77f626c5
...
@@ -1732,15 +1732,14 @@ static int setup_personality(signed long persona)
...
@@ -1732,15 +1732,14 @@ static int setup_personality(signed long persona)
{
{
int
ret
;
int
ret
;
if
(
persona
==
-
1
)
if
(
persona
==
LXC_ARCH_UNCHANGED
)
return
0
;
return
log_debug
(
0
,
"Retaining original personality"
)
;
ret
=
personality
(
persona
);
ret
=
personality
(
persona
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
log_error_errno
(
-
1
,
errno
,
"Failed to set personality to
\"
0x%
x
\"
"
,
persona
);
return
syserror
(
"Failed to set personality to
\"
0lx%l
x
\"
"
,
persona
);
INFO
(
"Set personality to
\"
0lx%lx
\"
"
,
persona
);
INFO
(
"Set personality to
\"
0lx%lx
\"
"
,
persona
);
return
0
;
return
0
;
}
}
...
@@ -2800,7 +2799,7 @@ struct lxc_conf *lxc_conf_init(void)
...
@@ -2800,7 +2799,7 @@ struct lxc_conf *lxc_conf_init(void)
return
NULL
;
return
NULL
;
new
->
loglevel
=
LXC_LOG_LEVEL_NOTSET
;
new
->
loglevel
=
LXC_LOG_LEVEL_NOTSET
;
new
->
personality
=
-
1
;
new
->
personality
=
LXC_ARCH_UNCHANGED
;
new
->
autodev
=
1
;
new
->
autodev
=
1
;
new
->
console
.
buffer_size
=
0
;
new
->
console
.
buffer_size
=
0
;
new
->
console
.
log_path
=
NULL
;
new
->
console
.
log_path
=
NULL
;
...
@@ -3731,7 +3730,7 @@ int lxc_setup(struct lxc_handler *handler)
...
@@ -3731,7 +3730,7 @@ int lxc_setup(struct lxc_handler *handler)
ret
=
setup_personality
(
lxc_conf
->
personality
);
ret
=
setup_personality
(
lxc_conf
->
personality
);
if
(
ret
<
0
)
if
(
ret
<
0
)
return
log_error
(
-
1
,
"Failed to set personality"
);
return
syserror
(
"Failed to set personality"
);
/* Set sysctl value to a path under /proc/sys as determined from the
/* Set sysctl value to a path under /proc/sys as determined from the
* key. For e.g. net.ipv4.ip_forward translated to
* key. For e.g. net.ipv4.ip_forward translated to
...
...
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