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
b87ee312
Unverified
Commit
b87ee312
authored
Mar 09, 2020
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tree-wide: more cleanup macros
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
768e7ba2
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
11 deletions
+10
-11
attach.c
src/lxc/attach.c
+2
-1
conf.c
src/lxc/conf.c
+1
-1
start.c
src/lxc/start.c
+7
-9
No files found.
src/lxc/attach.c
View file @
b87ee312
...
@@ -92,7 +92,8 @@ static struct lxc_proc_context_info *lxc_proc_get_context_info(pid_t pid)
...
@@ -92,7 +92,8 @@ static struct lxc_proc_context_info *lxc_proc_get_context_info(pid_t pid)
info
->
lsm_label
=
lsm_process_label_get
(
pid
);
info
->
lsm_label
=
lsm_process_label_get
(
pid
);
info
->
ns_inherited
=
0
;
info
->
ns_inherited
=
0
;
memset
(
info
->
ns_fd
,
-
1
,
sizeof
(
int
)
*
LXC_NS_MAX
);
for
(
int
i
=
0
;
i
<
LXC_NS_MAX
;
i
++
)
info
->
ns_fd
[
i
]
=
-
EBADF
;
return
move_ptr
(
info
);
return
move_ptr
(
info
);
}
}
...
...
src/lxc/conf.c
View file @
b87ee312
...
@@ -3547,7 +3547,7 @@ int lxc_setup(struct lxc_handler *handler)
...
@@ -3547,7 +3547,7 @@ int lxc_setup(struct lxc_handler *handler)
return
-
1
;
return
-
1
;
}
}
if
(
handler
->
nsfd
[
LXC_NS_UTS
]
==
-
1
)
{
if
(
handler
->
nsfd
[
LXC_NS_UTS
]
==
-
EBADF
)
{
ret
=
setup_utsname
(
lxc_conf
->
utsname
);
ret
=
setup_utsname
(
lxc_conf
->
utsname
);
if
(
ret
<
0
)
{
if
(
ret
<
0
)
{
ERROR
(
"Failed to setup the utsname %s"
,
name
);
ERROR
(
"Failed to setup the utsname %s"
,
name
);
...
...
src/lxc/start.c
View file @
b87ee312
...
@@ -122,9 +122,9 @@ static int lxc_try_preserve_ns(const int pid, const char *ns)
...
@@ -122,9 +122,9 @@ static int lxc_try_preserve_ns(const int pid, const char *ns)
errno
,
"Failed to preserve %s namespace"
,
errno
,
"Failed to preserve %s namespace"
,
ns
);
ns
);
return
log_
error
_errno
(
-
EOPNOTSUPP
,
return
log_
warn
_errno
(
-
EOPNOTSUPP
,
errno
,
"Kernel does not support preserving %s namespaces"
,
errno
,
"Kernel does not support preserving %s namespaces"
,
ns
);
ns
);
}
}
return
fd
;
return
fd
;
...
@@ -646,7 +646,7 @@ void lxc_free_handler(struct lxc_handler *handler)
...
@@ -646,7 +646,7 @@ void lxc_free_handler(struct lxc_handler *handler)
if
(
handler
->
conf
&&
handler
->
conf
->
reboot
==
REBOOT_NONE
)
if
(
handler
->
conf
&&
handler
->
conf
->
reboot
==
REBOOT_NONE
)
if
(
handler
->
conf
->
maincmd_fd
>=
0
)
if
(
handler
->
conf
->
maincmd_fd
>=
0
)
lxc_abstract_unix_close
(
handler
->
conf
->
maincmd_fd
);
close_prot_errno_disarm
(
handler
->
conf
->
maincmd_fd
);
if
(
handler
->
monitor_status_fd
>=
0
)
if
(
handler
->
monitor_status_fd
>=
0
)
close_prot_errno_disarm
(
handler
->
monitor_status_fd
);
close_prot_errno_disarm
(
handler
->
monitor_status_fd
);
...
@@ -892,8 +892,7 @@ out_aborting:
...
@@ -892,8 +892,7 @@ out_aborting:
(
void
)
lxc_set_state
(
name
,
handler
,
ABORTING
);
(
void
)
lxc_set_state
(
name
,
handler
,
ABORTING
);
out_close_maincmd_fd:
out_close_maincmd_fd:
lxc_abstract_unix_close
(
conf
->
maincmd_fd
);
close_prot_errno_disarm
(
conf
->
maincmd_fd
);
conf
->
maincmd_fd
=
-
1
;
return
-
1
;
return
-
1
;
}
}
...
@@ -981,8 +980,7 @@ void lxc_fini(const char *name, struct lxc_handler *handler)
...
@@ -981,8 +980,7 @@ void lxc_fini(const char *name, struct lxc_handler *handler)
* the command socket causing a new process to get ECONNREFUSED
* the command socket causing a new process to get ECONNREFUSED
* because we haven't yet closed the command socket.
* because we haven't yet closed the command socket.
*/
*/
lxc_abstract_unix_close
(
handler
->
conf
->
maincmd_fd
);
close_prot_errno_disarm
(
handler
->
conf
->
maincmd_fd
);
handler
->
conf
->
maincmd_fd
=
-
EBADF
;
TRACE
(
"Closed command socket"
);
TRACE
(
"Closed command socket"
);
/* This function will try to connect to the legacy lxc-monitord
/* This function will try to connect to the legacy lxc-monitord
...
@@ -1641,7 +1639,7 @@ static int lxc_spawn(struct lxc_handler *handler)
...
@@ -1641,7 +1639,7 @@ static int lxc_spawn(struct lxc_handler *handler)
*/
*/
if
(
!
wants_to_map_ids
)
{
if
(
!
wants_to_map_ids
)
{
handler
->
pinfd
=
pin_rootfs
(
conf
->
rootfs
.
path
);
handler
->
pinfd
=
pin_rootfs
(
conf
->
rootfs
.
path
);
if
(
handler
->
pinfd
==
-
1
)
if
(
handler
->
pinfd
==
-
EBADF
)
INFO
(
"Failed to pin the rootfs for container
\"
%s
\"
"
,
handler
->
name
);
INFO
(
"Failed to pin the rootfs for container
\"
%s
\"
"
,
handler
->
name
);
}
}
...
...
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