]> git.proxmox.com Git - mirror_lxc.git/commitdiff
tools: move lxc-stop to API symbols only
authorChristian Brauner <christian.brauner@ubuntu.com>
Fri, 12 Jan 2018 15:17:46 +0000 (16:17 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Tue, 6 Feb 2018 20:10:48 +0000 (21:10 +0100)
Closes #2073.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/tools/lxc_stop.c

index 9d2ba6ed14ddc3458447d4588a002946562edd41..f133c99770fb03837e46f6f5c87a84022f9e58c8 100644 (file)
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  */
-#include <stdio.h>
+
+#define _GNU_SOURCE
 #include <libgen.h>
-#include <unistd.h>
+#include <stdio.h>
+#include <string.h>
 #include <sys/types.h>
+#include <unistd.h>
 
 #include <lxc/lxccontainer.h>
 
-#include "lxc.h"
-#include "log.h"
 #include "arguments.h"
-#include "commands.h"
-#include "utils.h"
+#include "tool_utils.h"
 
 #define OPT_NO_LOCK OPT_USAGE + 1
 #define OPT_NO_KILL OPT_USAGE + 2
@@ -113,7 +113,6 @@ int main(int argc, char *argv[])
 
        if (lxc_log_init(&log))
                exit(ret);
-       lxc_log_options_no_override();
 
        /* REMOVE IN LXC 3.0 */
        setenv("LXC_UPDATE_CONFIG_FORMAT", "1", 0);
@@ -155,13 +154,6 @@ int main(int argc, char *argv[])
                exit(ret);
        }
 
-       /* shortcut - if locking is bogus, we should be able to kill
-        * containers at least */
-       if (my_args.nolock) {
-               ret = lxc_cmd_stop(my_args.name, my_args.lxcpath[0]);
-               exit(ret);
-       }
-
        c = lxc_container_new(my_args.name, my_args.lxcpath[0]);
        if (!c) {
                fprintf(stderr, "Error opening container\n");