diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-12-12 16:45:33 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-12-12 16:45:33 +0100 |
commit | 303ee601513d64c23fcff0925894051c3baf0c50 (patch) | |
tree | 13eabdb12f75ea0405f223ca1d8b2585b571a89a /src/tmpfiles | |
parent | 9be3c605706cd8430e330e9d16df372f5daccce2 (diff) | |
download | systemd-303ee601513d64c23fcff0925894051c3baf0c50.tar.gz systemd-303ee601513d64c23fcff0925894051c3baf0c50.tar.bz2 systemd-303ee601513d64c23fcff0925894051c3baf0c50.zip |
Mark *data and *userdata params to specifier_printf() as const
It would be very wrong if any of the specfier printf calls modified
any of the objects or data being printed. Let's mark all arguments as const
(primarily to make it easier for the reader to see where modifications cannot
occur).
Diffstat (limited to 'src/tmpfiles')
-rw-r--r-- | src/tmpfiles/tmpfiles.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index 08c57a3fb1..19225f8cfd 100644 --- a/src/tmpfiles/tmpfiles.c +++ b/src/tmpfiles/tmpfiles.c @@ -180,8 +180,8 @@ STATIC_DESTRUCTOR_REGISTER(arg_include_prefixes, freep); STATIC_DESTRUCTOR_REGISTER(arg_exclude_prefixes, freep); STATIC_DESTRUCTOR_REGISTER(arg_root, freep); -static int specifier_machine_id_safe(char specifier, void *data, void *userdata, char **ret); -static int specifier_directory(char specifier, void *data, void *userdata, char **ret); +static int specifier_machine_id_safe(char specifier, const void *data, const void *userdata, char **ret); +static int specifier_directory(char specifier, const void *data, const void *userdata, char **ret); static const Specifier specifier_table[] = { { 'm', specifier_machine_id_safe, NULL }, @@ -204,7 +204,7 @@ static const Specifier specifier_table[] = { {} }; -static int specifier_machine_id_safe(char specifier, void *data, void *userdata, char **ret) { +static int specifier_machine_id_safe(char specifier, const void *data, const void *userdata, char **ret) { int r; /* If /etc/machine_id is missing or empty (e.g. in a chroot environment) @@ -218,7 +218,7 @@ static int specifier_machine_id_safe(char specifier, void *data, void *userdata, return r; } -static int specifier_directory(char specifier, void *data, void *userdata, char **ret) { +static int specifier_directory(char specifier, const void *data, const void *userdata, char **ret) { struct table_entry { uint64_t type; const char *suffix; |