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
d5865e7e
Unverified
Commit
d5865e7e
authored
May 26, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
conf: pts -> pty_max
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
dfb24c15
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
8 deletions
+13
-8
conf.c
src/lxc/conf.c
+3
-3
conf.h
src/lxc/conf.h
+1
-1
confile.c
src/lxc/confile.c
+9
-4
No files found.
src/lxc/conf.c
View file @
d5865e7e
...
...
@@ -1523,14 +1523,14 @@ static int lxc_setup_devpts(struct lxc_conf *conf)
const
char
*
default_devpts_mntopts
=
"gid=5,newinstance,ptmxmode=0666,mode=0620"
;
char
devpts_mntopts
[
256
];
if
(
conf
->
pt
s
<=
0
)
{
if
(
conf
->
pt
y_max
<=
0
)
{
DEBUG
(
"No new devpts instance will be mounted since no pts "
"devices are requested"
);
return
0
;
}
ret
=
snprintf
(
devpts_mntopts
,
sizeof
(
devpts_mntopts
),
"%s,max=%
d
"
,
default_devpts_mntopts
,
conf
->
pt
s
);
ret
=
snprintf
(
devpts_mntopts
,
sizeof
(
devpts_mntopts
),
"%s,max=%
zu
"
,
default_devpts_mntopts
,
conf
->
pt
y_max
);
if
(
ret
<
0
||
(
size_t
)
ret
>=
sizeof
(
devpts_mntopts
))
return
-
1
;
...
...
src/lxc/conf.h
View file @
d5865e7e
...
...
@@ -255,8 +255,8 @@ struct lxc_conf {
/* Comma-separated list of lxc.tty.max pty names. */
struct
lxc_tty_info
ttys
;
size_t
pty_max
;
unsigned
int
pts
;
struct
lxc_terminal
console
;
struct
lxc_rootfs
rootfs
;
bool
close_all_fds
;
...
...
src/lxc/confile.c
View file @
d5865e7e
...
...
@@ -974,14 +974,19 @@ static int set_config_personality(const char *key, const char *value,
static
int
set_config_pty_max
(
const
char
*
key
,
const
char
*
value
,
struct
lxc_conf
*
lxc_conf
,
void
*
data
)
{
int
ret
;
unsigned
int
max
=
0
;
if
(
lxc_config_value_empty
(
value
))
{
lxc_conf
->
pt
s
=
0
;
lxc_conf
->
pt
y_max
=
0
;
return
0
;
}
if
(
lxc_safe_uint
(
value
,
&
lxc_conf
->
pts
)
<
0
)
ret
=
lxc_safe_uint
(
value
,
&
max
);
if
(
ret
<
0
)
return
-
1
;
lxc_conf
->
pty_max
=
max
;
return
0
;
}
...
...
@@ -2905,7 +2910,7 @@ static int get_config_personality(const char *key, char *retv, int inlen,
static
int
get_config_pty_max
(
const
char
*
key
,
char
*
retv
,
int
inlen
,
struct
lxc_conf
*
c
,
void
*
data
)
{
return
lxc_get_conf_
int
(
c
,
retv
,
inlen
,
c
->
pts
);
return
lxc_get_conf_
size_t
(
c
,
retv
,
inlen
,
c
->
pty_max
);
}
static
int
get_config_tty_max
(
const
char
*
key
,
char
*
retv
,
int
inlen
,
...
...
@@ -3682,7 +3687,7 @@ static inline int clr_config_personality(const char *key, struct lxc_conf *c,
static
inline
int
clr_config_pty_max
(
const
char
*
key
,
struct
lxc_conf
*
c
,
void
*
data
)
{
c
->
pt
s
=
0
;
c
->
pt
y_max
=
0
;
return
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