fixed compilation for disabled compat/legacy API
authorEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Sun, 22 Jan 2006 18:17:24 +0000 (18:17 +0000)
committerEnrico Scholz <enrico.scholz@informatik.tu-chemnitz.de>
Sun, 22 Jan 2006 18:17:24 +0000 (18:17 +0000)
git-svn-id: http://svn.linux-vserver.org/svn/util-vserver/trunk@2270 94cd875c-1c1d-0410-91d2-eb244daf1a30

util-vserver/src/chbind.c
util-vserver/src/rpm-fake-resolver.c
util-vserver/src/vserver-info.c

index 497e482..4fb628e 100644 (file)
@@ -342,17 +342,27 @@ int main (int argc, char *argv[])
     exit(wrapper_exit_code);
   }
   
-
+#if !defined(VC_ENABLE_API_NET) && !defined(VC_ENABLE_API_COMPAT) && !defined(VC_ENABLE_API_LEGACY)
+#  error can not build 'chbind' without network virtualization API
+#endif
+  
 #if defined(VC_ENABLE_API_NET)
   if (vc_isSupported(vcFEATURE_VNET)) {
     make_nx(nid, bcast, nbaddrs, ips);
   }
   else
 #endif
+#if defined(VC_ENABLE_API_COMPAT) || defined(VC_ENABLE_API_LEGACY)
   if (vc_set_ipv4root(bcast,nbaddrs,ips)!=0) {
     perror("chbind: vc_set_ipv4root()");
     exit(wrapper_exit_code);
   }
+#else
+  {
+    WRITE_MSG(2, "chbind: kernel does not provide network virtualization\n");
+    exit(wrapper_exit_code);
+  }
+#endif
 
   if (!is_silent) {
     size_t             i;
index 39438b4..ce91ad7 100644 (file)
@@ -250,7 +250,7 @@ daemonize(struct ArgInfo const UNUSED * args, int pid_fd)
 
 static void
 activateContext(xid_t xid, bool in_ctx,
-               uint32_t xid_caps, int xid_flags)
+               uint32_t UNUSED xid_caps, int UNUSED xid_flags)
 {
   if (in_ctx) {
     struct vc_ctx_flags                flags = {
index 0895020..d695fee 100644 (file)
@@ -320,6 +320,13 @@ getInitPid_emulated(char *buf, xid_t xid)
 
   return 0;
 }
+#else // VC_ENABLE_API_COMPAT
+static char *
+getInitPid_emulated(char UNUSED *buf, xid_t UNUSED xid)
+{
+  WRITE_MSG(2, "tools were built without compat API, getInitPid() not available\n");
+  return 0;
+}
 #endif // VC_ENABLE_API_COMPAT
 
 static char *