diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2018-04-03 17:14:42 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-04-03 17:14:42 +0200 |
| commit | 53397a95e3a2cae43f1e43c0a56f67b8cc1a682b (patch) | |
| tree | 61834c48a999cbbfa7a28625c0f7adf9de8e0d3a /lib | |
| parent | 4eb81e58d96dfe2cca9c2427ba2a7545fd69bed8 (diff) | |
| parent | 290d80a7208f20f53f8cd6a5c9c516b4aba7968e (diff) | |
Merge pull request #2010 from donaldsharp/ns_fixes
lib: Namespaces should only complain about failure if we have it
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/netns_linux.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/netns_linux.c b/lib/netns_linux.c index 01616be711..3d61cecc03 100644 --- a/lib/netns_linux.c +++ b/lib/netns_linux.c @@ -412,9 +412,12 @@ void ns_init(void) return; errno = 0; #ifdef HAVE_NETNS - if (have_netns_enabled < 0) + if (have_netns_enabled < 0) { ns_default_ns_fd = open(NS_DEFAULT_NAME, O_RDONLY); - else { + if (ns_default_ns_fd == -1) + zlog_err("NS initialization failure %d(%s)", + errno, safe_strerror(errno)); + } else { ns_default_ns_fd = -1; default_ns = NULL; } @@ -422,9 +425,6 @@ void ns_init(void) ns_default_ns_fd = -1; default_ns = NULL; #endif /* HAVE_NETNS */ - if (ns_default_ns_fd == -1) - zlog_err("NS initialisation failure (%s)", - safe_strerror(errno)); ns_current_ns_fd = -1; ns_initialised = 1; } |
