From 3ec82d4b6aa9badbc8f78da95f7375fd050b2953 Mon Sep 17 00:00:00 2001 From: Ronny Chevalier Date: Mon, 18 Jun 2018 10:55:35 +0200 Subject: [PATCH] lib/c: add const qualifier to criu_set_service_binary service_binary is either set to a const char * (CR_DEFAULT_SERVICE_BIN) or to a user provided char *, but there is no reason to give a char *. Users of such function will most likely provide a const char *, that will generate a warning. Thus, we add the const qualifier to better represent the usage of service_binary, and avoid such warnings. Signed-off-by: Ronny Chevalier Signed-off-by: Andrei Vagin --- lib/c/criu.c | 6 +++--- lib/c/criu.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/c/criu.c b/lib/c/criu.c index 832a54d10..ff9c9b87e 100644 --- a/lib/c/criu.c +++ b/lib/c/criu.c @@ -27,7 +27,7 @@ struct criu_opts { union { char *service_address; int service_fd; - char *service_binary; + const char *service_binary; }; int swrk_pid; }; @@ -68,7 +68,7 @@ void criu_set_service_fd(int fd) criu_local_set_service_fd(global_opts, fd); } -void criu_local_set_service_binary(criu_opts *opts, char *path) +void criu_local_set_service_binary(criu_opts *opts, const char *path) { if (path) opts->service_binary = path; @@ -76,7 +76,7 @@ void criu_local_set_service_binary(criu_opts *opts, char *path) opts->service_binary = CR_DEFAULT_SERVICE_BIN; } -void criu_set_service_binary(char *path) +void criu_set_service_binary(const char *path) { criu_local_set_service_binary(global_opts, path); } diff --git a/lib/c/criu.h b/lib/c/criu.h index 5d0b5b6c0..c531016e2 100644 --- a/lib/c/criu.h +++ b/lib/c/criu.h @@ -43,7 +43,7 @@ enum criu_cg_mode { void criu_set_service_address(char *path); void criu_set_service_fd(int fd); -void criu_set_service_binary(char *path); +void criu_set_service_binary(const char *path); /* * You can choose if you want libcriu to connect to service socket