pidns: add reboot_pid_ns() to handle the reboot syscall
[linux-flexiantxendom0-3.2.10.git] / kernel / sys.c
index 9eb7fca..e7006eb 100644 (file)
@@ -444,6 +444,15 @@ SYSCALL_DEFINE4(reboot, int, magic1, int, magic2, unsigned int, cmd,
                        magic2 != LINUX_REBOOT_MAGIC2C))
                return -EINVAL;
 
+       /*
+        * If pid namespaces are enabled and the current task is in a child
+        * pid_namespace, the command is handled by reboot_pid_ns() which will
+        * call do_exit().
+        */
+       ret = reboot_pid_ns(task_active_pid_ns(current), cmd);
+       if (ret)
+               return ret;
+
        /* Instead of trying to make the power_off code look like
         * halt when pm_power_off is not set do it the easy way.
         */