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 <ronny.chevalier@hp.com>
Signed-off-by: Andrei Vagin <avagin@virtuozzo.com>
This commit is contained in:
Ronny Chevalier 2018-06-18 10:55:35 +02:00 committed by Andrei Vagin
parent 8697e7837c
commit 72dc405b3f
2 changed files with 4 additions and 4 deletions

View file

@ -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);
}

View file

@ -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