aboutsummaryrefslogtreecommitdiff
path: root/gdb/nat/linux-namespaces.c
diff options
context:
space:
mode:
authorPeter Bergner <bergner@vnet.ibm.com>2015-07-14 10:46:16 -0500
committerPeter Bergner <bergner@vnet.ibm.com>2015-07-14 10:46:16 -0500
commit99fe86f7999afd2743b08c550b10f083ae4bd9bd (patch)
tree3067a4c671d68bb9376071d56d8d374654714614 /gdb/nat/linux-namespaces.c
parent8a643cc36cf121de3a9131f95547eba927413710 (diff)
downloadgdb-99fe86f7999afd2743b08c550b10f083ae4bd9bd.zip
gdb-99fe86f7999afd2743b08c550b10f083ae4bd9bd.tar.gz
gdb-99fe86f7999afd2743b08c550b10f083ae4bd9bd.tar.bz2
Fix build issue with nat/linux-namespaces.c.
* nat/linux-namespaces.c (setns): Rename from this ... (do_setns): ... to this. Support calling setns if it exists. (mnsh_handle_setns): Call do_setns.
Diffstat (limited to 'gdb/nat/linux-namespaces.c')
-rw-r--r--gdb/nat/linux-namespaces.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/gdb/nat/linux-namespaces.c b/gdb/nat/linux-namespaces.c
index a7a3e4d..fd0d4b0 100644
--- a/gdb/nat/linux-namespaces.c
+++ b/gdb/nat/linux-namespaces.c
@@ -34,18 +34,18 @@ int debug_linux_namespaces;
/* Handle systems without setns. */
-#ifndef HAVE_SETNS
-static int
-setns (int fd, int nstype)
+static inline int
+do_setns (int fd, int nstype)
{
-#ifdef __NR_setns
+#ifdef HAVE_SETNS
+ return setns (fd, nstype);
+#elif defined __NR_setns
return syscall (__NR_setns, fd, nstype);
#else
errno = ENOSYS;
return -1;
#endif
}
-#endif
/* Handle systems without MSG_CMSG_CLOEXEC. */
@@ -495,7 +495,7 @@ mnsh_recv_message (int sock, enum mnsh_msg_type *type,
static ssize_t
mnsh_handle_setns (int sock, int fd, int nstype)
{
- int result = setns (fd, nstype);
+ int result = do_setns (fd, nstype);
return mnsh_return_int (sock, result, errno);
}