Commit 3ec82d4b authored by Ronny Chevalier's avatar Ronny Chevalier Committed by Pavel Emelyanov

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: 's avatarRonny Chevalier <ronny.chevalier@hp.com>
Signed-off-by: 's avatarAndrei Vagin <avagin@virtuozzo.com>
parent 55d0f98f
...@@ -27,7 +27,7 @@ struct criu_opts { ...@@ -27,7 +27,7 @@ struct criu_opts {
union { union {
char *service_address; char *service_address;
int service_fd; int service_fd;
char *service_binary; const char *service_binary;
}; };
int swrk_pid; int swrk_pid;
}; };
...@@ -68,7 +68,7 @@ void criu_set_service_fd(int fd) ...@@ -68,7 +68,7 @@ void criu_set_service_fd(int fd)
criu_local_set_service_fd(global_opts, 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) if (path)
opts->service_binary = path; opts->service_binary = path;
...@@ -76,7 +76,7 @@ void criu_local_set_service_binary(criu_opts *opts, char *path) ...@@ -76,7 +76,7 @@ void criu_local_set_service_binary(criu_opts *opts, char *path)
opts->service_binary = CR_DEFAULT_SERVICE_BIN; 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); criu_local_set_service_binary(global_opts, path);
} }
......
...@@ -43,7 +43,7 @@ enum criu_cg_mode { ...@@ -43,7 +43,7 @@ enum criu_cg_mode {
void criu_set_service_address(char *path); void criu_set_service_address(char *path);
void criu_set_service_fd(int fd); 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 * You can choose if you want libcriu to connect to service socket
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment