[lxc-devel] [PATCH] Bring static and const to tests too

Serge Hallyn serge.hallyn at ubuntu.com
Thu Jan 2 15:57:24 UTC 2014


Quoting Andrey Mazo (mazo at telum.ru):
> Signed-off-by: Andrey Mazo <mazo at telum.ru>

Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>

> ---
>  src/tests/attach.c      | 2 +-
>  src/tests/concurrent.c  | 4 ++--
>  src/tests/list.c        | 2 +-
>  src/tests/locktests.c   | 2 +-
>  src/tests/may_control.c | 4 ++--
>  src/tests/reboot.c      | 2 +-
>  src/tests/snapshot.c    | 2 +-
>  7 files changed, 9 insertions(+), 9 deletions(-)
> 
> diff --git a/src/tests/attach.c b/src/tests/attach.c
> index 54f899f..22b6345 100644
> --- a/src/tests/attach.c
> +++ b/src/tests/attach.c
> @@ -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;
> diff --git a/src/tests/concurrent.c b/src/tests/concurrent.c
> index 7145d99..bcb5f2c 100644
> --- a/src/tests/concurrent.c
> +++ b/src/tests/concurrent.c
> @@ -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)
> diff --git a/src/tests/list.c b/src/tests/list.c
> index 9559c23..9641dcc 100644
> --- a/src/tests/list.c
> +++ b/src/tests/list.c
> @@ -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];
> diff --git a/src/tests/locktests.c b/src/tests/locktests.c
> index 360851f..d036166 100644
> --- a/src/tests/locktests.c
> +++ b/src/tests/locktests.c
> @@ -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;
> diff --git a/src/tests/may_control.c b/src/tests/may_control.c
> index c176087..bb7000c 100644
> --- a/src/tests/may_control.c
> +++ b/src/tests/may_control.c
> @@ -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;
>  
> diff --git a/src/tests/reboot.c b/src/tests/reboot.c
> index b27d523..55b5028 100644
> --- a/src/tests/reboot.c
> +++ b/src/tests/reboot.c
> @@ -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;
> diff --git a/src/tests/snapshot.c b/src/tests/snapshot.c
> index d9fed36..e934a36 100644
> --- a/src/tests/snapshot.c
> +++ b/src/tests/snapshot.c
> @@ -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];
> -- 
> 1.8.4.5
> 
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel


More information about the lxc-devel mailing list