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
d852c78c
Commit
d852c78c
authored
Oct 09, 2009
by
Daniel Lezcano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use the configuration structure for pts
Avoid to use the directory structure. Signed-off-by:
Daniel Lezcano
<
dlezcano@fr.ibm.com
>
parent
4e5440c6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
33 deletions
+6
-33
conf.c
src/lxc/conf.c
+6
-33
No files found.
src/lxc/conf.c
View file @
d852c78c
...
...
@@ -605,28 +605,6 @@ static int configure_rootfs(const char *name, const char *rootfs)
return
-
1
;
}
static
int
configure_pts
(
const
char
*
name
,
int
pts
)
{
char
path
[
MAXPATHLEN
];
char
*
maxpts
;
int
ret
;
if
(
asprintf
(
&
maxpts
,
"%d"
,
pts
)
<
0
)
{
ERROR
(
"failed to convert max pts number"
);
return
-
1
;
}
snprintf
(
path
,
MAXPATHLEN
,
LXCPATH
"/%s"
,
name
);
ret
=
write_info
(
path
,
"pts"
,
maxpts
);
if
(
ret
)
ERROR
(
"failed to write the pts info"
);
free
(
maxpts
);
return
ret
;
}
static
int
configure_mount
(
const
char
*
name
,
const
char
*
fstab
)
{
char
path
[
MAXPATHLEN
];
...
...
@@ -859,18 +837,17 @@ out:
return
ret
;
}
static
int
setup_pts
(
const
char
*
name
)
static
int
setup_pts
(
int
pts
)
{
char
mountname
[
MAXPATHLEN
];
if
(
!
pts
)
return
0
;
if
(
!
access
(
"/dev/pts/ptmx"
,
F_OK
)
&&
umount
(
"/dev/pts"
))
{
SYSERROR
(
"failed to umount 'dev/pts'"
);
return
-
1
;
}
snprintf
(
mountname
,
MAXPATHLEN
,
"%spts"
,
name
);
if
(
mount
(
mountname
,
"/dev/pts"
,
"devpts"
,
MS_MGC_VAL
,
"newinstance"
))
{
if
(
mount
(
"devpts"
,
"/dev/pts"
,
"devpts"
,
MS_MGC_VAL
,
"newinstance"
))
{
SYSERROR
(
"failed to mount a new instance of '/dev/pts'"
);
return
-
1
;
}
...
...
@@ -894,6 +871,7 @@ static int setup_pts(const char *name)
}
INFO
(
"created new pts instance"
);
out:
return
0
;
}
...
...
@@ -1425,11 +1403,6 @@ int lxc_configure(const char *name, struct lxc_conf *conf)
return
-
1
;
}
if
(
conf
->
pts
&&
configure_pts
(
name
,
conf
->
pts
))
{
ERROR
(
"failed to configure a new pts instance"
);
return
-
1
;
}
return
0
;
}
...
...
@@ -1851,7 +1824,7 @@ int lxc_setup(const char *name, const char *cons,
return
-
1
;
}
if
(
lxc_conf
.
pts
&&
setup_pts
(
name
))
{
if
(
setup_pts
(
lxc_conf
.
pts
))
{
ERROR
(
"failed to setup the new pts instance"
);
return
-
1
;
}
...
...
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