mirror of
https://github.com/systemd/systemd.git
synced 2025-03-19 22:50:17 +03:00
nsresource: fix error handling
This commit is contained in:
parent
e66c71a786
commit
36a9e47a0d
@ -116,7 +116,7 @@ int nsresource_register_userns(const char *name, int userns_fd) {
|
||||
if (userns_fd < 0) {
|
||||
_userns_fd = namespace_open_by_type(NAMESPACE_USER);
|
||||
if (_userns_fd < 0)
|
||||
return -errno;
|
||||
return _userns_fd;
|
||||
|
||||
userns_fd = _userns_fd;
|
||||
}
|
||||
@ -213,7 +213,7 @@ int nsresource_add_cgroup(int userns_fd, int cgroup_fd) {
|
||||
if (userns_fd < 0) {
|
||||
_userns_fd = namespace_open_by_type(NAMESPACE_USER);
|
||||
if (_userns_fd < 0)
|
||||
return -errno;
|
||||
return _userns_fd;
|
||||
|
||||
userns_fd = _userns_fd;
|
||||
}
|
||||
@ -281,7 +281,7 @@ int nsresource_add_netif(
|
||||
if (userns_fd < 0) {
|
||||
_userns_fd = namespace_open_by_type(NAMESPACE_USER);
|
||||
if (_userns_fd < 0)
|
||||
return -errno;
|
||||
return _userns_fd;
|
||||
|
||||
userns_fd = _userns_fd;
|
||||
}
|
||||
@ -289,7 +289,7 @@ int nsresource_add_netif(
|
||||
if (netns_fd < 0) {
|
||||
_netns_fd = namespace_open_by_type(NAMESPACE_NET);
|
||||
if (_netns_fd < 0)
|
||||
return -errno;
|
||||
return _netns_fd;
|
||||
|
||||
netns_fd = _netns_fd;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user