]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Bring static and const to tests too
authorAndrey Mazo <mazo@telum.ru>
Wed, 25 Dec 2013 12:03:43 +0000 (16:03 +0400)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Thu, 2 Jan 2014 15:56:36 +0000 (09:56 -0600)
Signed-off-by: Andrey Mazo <mazo@telum.ru>
Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/tests/attach.c
src/tests/concurrent.c
src/tests/list.c
src/tests/locktests.c
src/tests/may_control.c
src/tests/reboot.c
src/tests/snapshot.c

index b63c6339c967977d2181d4326f7adf74adfc1d09..d028265552ddb007924c6432d2a780d70829f8d7 100644 (file)
@@ -332,7 +332,7 @@ out1:
 }
 
 
-int test_attach(const char *lxcpath, const char *name, const char *template)
+static int test_attach(const char *lxcpath, const char *name, const char *template)
 {
        int ret = -1;
        struct lxc_container *ct;
index 7145d99c3e9cff426e980ee1b432ba7daebceb1d..bcb5f2c02fd405b98abcdfd1786faa274d74d825 100644 (file)
@@ -33,7 +33,7 @@ static int quiet = 0;
 static int delay = 0;
 static const char *template = "busybox";
 
-static struct option options[] = {
+static const struct option options[] = {
     { "threads",     required_argument, NULL, 'j' },
     { "iterations",  required_argument, NULL, 'i' },
     { "template",    required_argument, NULL, 't' },
@@ -63,7 +63,7 @@ static void usage(void) {
 struct thread_args {
     int thread_id;
     int return_code;
-    char *mode;
+    const char *mode;
 };
 
 static void do_function(void *arguments)
index 9559c231824101b026307a0201eb7b4850a1d9b4..9641dccbb1350e54483c36e22d97caedc7438277 100644 (file)
@@ -80,7 +80,7 @@ static void test_list_func(const char *lxcpath, const char *type,
 
 int main(int argc, char *argv[])
 {
-       char *lxcpath = NULL;
+       const char *lxcpath = NULL;
 
        if (argc > 1)
                lxcpath = argv[1];
index 191414c069e3702860ed430747b52f2f068c7e26..c3f5352ceeb7f19de775485652d55539fc251968 100644 (file)
@@ -27,7 +27,7 @@
 #define mycontainername "lxctest.sem"
 #define TIMEOUT_SECS 3
 
-void test_two_locks(void)
+static void test_two_locks(void)
 {
        struct lxc_lock *l;
        pid_t pid;
index c1760875ed8f9c88453e6e12c5ae3a8225c2437d..bb7000caacd284b60056f3392c18961a42414f9f 100644 (file)
@@ -21,7 +21,7 @@
 #include <stdlib.h>
 #include <lxc/lxccontainer.h>
 
-void usage(char *me)
+static void usage(const char *me)
 {
        printf("Usage: %s name [lxcpath]\n", me);
        exit(0);
@@ -29,7 +29,7 @@ void usage(char *me)
 
 int main(int argc, char *argv[])
 {
-       char *lxcpath = NULL, *name;
+       const char *lxcpath = NULL, *name;
        bool may = false;
        struct lxc_container *c;
 
index 3601e0dba4548864450926e259e457d1329e46f4..5583332ac7a7c5884e4e0a47279e0ddfe37519cb 100644 (file)
@@ -42,7 +42,7 @@ static int do_reboot(void *arg)
        return 0;
 }
 
-int test_reboot(int cmd, int sig)
+static int test_reboot(int cmd, int sig)
 {
         long stack_size = 4096;
         void *stack = alloca(stack_size) + stack_size;
index 6e13932ed96eb747021bb892fd5ae347e5e29179..da7b40927f546e3eb8ee53e57197a5fe756d89af 100644 (file)
@@ -28,7 +28,7 @@
 #define MYNAME "snapxxx1"
 #define RESTNAME "snapxxx2"
 
-void try_to_remove()
+static void try_to_remove(void)
 {
        struct lxc_container *c;
        char snappath[1024];