s!/etc/slackware-release!/etc/slackware-version! (reported by bubulak)
[util-vserver.git] / util-vserver / lib_internal / switchtowatchxid.c
index cea37fe..35be736 100644 (file)
@@ -22,8 +22,9 @@
 
 #include <vserver.h>
 #include <errno.h>
+#include <unistd.h>
 
-  // try to switch in context 1
+  // try to switch into context 1
 bool
 switchToWatchXid(char const **errptr)
 {
@@ -34,16 +35,9 @@ switchToWatchXid(char const **errptr)
   if (vc_get_task_xid(0)==1) return true;
 
   if (vc_isSupported(vcFEATURE_MIGRATE)) {
-    if (vc_ctx_create(1)==VC_NOCTX) {
-      if (errno!=EEXIST) {
-       if (errptr) *errptr = "vc_create_context()";
-       return false;
-      }
-
-      if (vc_ctx_migrate(1)==-1) {
-       if (errptr) *errptr = "vc_migrate_context()";
-       return false;
-      }
+    if (vc_ctx_migrate(1)==-1) {
+      if (errptr) *errptr = "vc_migrate_context()";
+      return false;
     }
   }
   else {