From: Daan De Meyer Date: Tue, 25 Nov 2025 12:44:03 +0000 (+0100) Subject: tree-wide: Fix declaration/definition parameter name mismatches X-Git-Tag: v259-rc2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6a9f0641cd924a5bb41f63a2b9e18838b11db9b9;p=thirdparty%2Fsystemd.git tree-wide: Fix declaration/definition parameter name mismatches --- diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c index 207f5428b70..efecde977cd 100644 --- a/src/basic/cgroup-util.c +++ b/src/basic/cgroup-util.c @@ -1628,18 +1628,18 @@ int cg_mask_to_string(CGroupMask mask, char **ret) { return 0; } -int cg_mask_from_string(const char *value, CGroupMask *ret) { +int cg_mask_from_string(const char *s, CGroupMask *ret) { CGroupMask m = 0; assert(ret); - assert(value); + assert(s); for (;;) { _cleanup_free_ char *n = NULL; CGroupController v; int r; - r = extract_first_word(&value, &n, NULL, 0); + r = extract_first_word(&s, &n, NULL, 0); if (r < 0) return r; if (r == 0) diff --git a/src/basic/cleanup-util.h b/src/basic/cleanup-util.h index 2d58b6654ab..dbe022295ad 100644 --- a/src/basic/cleanup-util.h +++ b/src/basic/cleanup-util.h @@ -27,31 +27,33 @@ typedef void* (*mfree_func_t)(void *p); 0; \ }) -#define _DEFINE_TRIVIAL_REF_FUNC(type, name, scope) \ - scope type *name##_ref(type *p) { \ - if (!p) \ - return NULL; \ - \ - /* For type check. */ \ - unsigned *q = &p->n_ref; \ - assert(*q > 0); \ - assert_se(*q < UINT_MAX); \ - \ - (*q)++; \ - return p; \ +#define _DEFINE_TRIVIAL_REF_FUNC(type, name, scope) \ + /* NOLINTNEXTLINE (readability-inconsistent-declaration-parameter-name) */ \ + scope type *name##_ref(type *p) { \ + if (!p) \ + return NULL; \ + \ + /* For type check. */ \ + unsigned *q = &p->n_ref; \ + assert(*q > 0); \ + assert_se(*q < UINT_MAX); \ + \ + (*q)++; \ + return p; \ } -#define _DEFINE_TRIVIAL_UNREF_FUNC(type, name, free_func, scope) \ - scope type *name##_unref(type *p) { \ - if (!p) \ - return NULL; \ - \ - assert(p->n_ref > 0); \ - p->n_ref--; \ - if (p->n_ref > 0) \ - return NULL; \ - \ - return free_func(p); \ +#define _DEFINE_TRIVIAL_UNREF_FUNC(type, name, free_func, scope) \ + /* NOLINTNEXTLINE (readability-inconsistent-declaration-parameter-name) */ \ + scope type *name##_unref(type *p) { \ + if (!p) \ + return NULL; \ + \ + assert(p->n_ref > 0); \ + p->n_ref--; \ + if (p->n_ref > 0) \ + return NULL; \ + \ + return free_func(p); \ } #define DEFINE_TRIVIAL_REF_FUNC(type, name) \ diff --git a/src/basic/compress.c b/src/basic/compress.c index 2aca7efc08e..5c13065e7c5 100644 --- a/src/basic/compress.c +++ b/src/basic/compress.c @@ -1029,7 +1029,7 @@ int decompress_stream_xz(int fdf, int fdt, uint64_t max_bytes) { #endif } -int decompress_stream_lz4(int in, int out, uint64_t max_bytes) { +int decompress_stream_lz4(int fdf, int fdt, uint64_t max_bytes) { #if HAVE_LZ4 size_t c; _cleanup_(LZ4F_freeDecompressionContextp) LZ4F_decompressionContext_t ctx = NULL; @@ -1047,7 +1047,7 @@ int decompress_stream_lz4(int in, int out, uint64_t max_bytes) { if (sym_LZ4F_isError(c)) return -ENOMEM; - if (fstat(in, &st) < 0) + if (fstat(fdf, &st) < 0) return log_debug_errno(errno, "fstat() failed: %m"); if (file_offset_beyond_memory_size(st.st_size)) @@ -1057,7 +1057,7 @@ int decompress_stream_lz4(int in, int out, uint64_t max_bytes) { if (!buf) return -ENOMEM; - src = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, in, 0); + src = mmap(NULL, st.st_size, PROT_READ, MAP_PRIVATE, fdf, 0); if (src == MAP_FAILED) return -errno; @@ -1080,7 +1080,7 @@ int decompress_stream_lz4(int in, int out, uint64_t max_bytes) { goto cleanup; } - r = loop_write(out, buf, produced); + r = loop_write(fdt, buf, produced); if (r < 0) goto cleanup; } diff --git a/src/basic/compress.h b/src/basic/compress.h index d3a09126efa..6a7486af0ce 100644 --- a/src/basic/compress.h +++ b/src/basic/compress.h @@ -13,9 +13,9 @@ typedef enum Compression { } Compression; const char* compression_to_string(Compression compression) _const_; -Compression compression_from_string(const char *compression) _pure_; +Compression compression_from_string(const char *s) _pure_; const char* compression_lowercase_to_string(Compression compression) _const_; -Compression compression_lowercase_from_string(const char *compression) _pure_; +Compression compression_lowercase_from_string(const char *s) _pure_; bool compression_supported(Compression c); @@ -58,9 +58,9 @@ int compress_stream_xz(int fdf, int fdt, uint64_t max_bytes, uint64_t *ret_uncom int compress_stream_lz4(int fdf, int fdt, uint64_t max_bytes, uint64_t *ret_uncompressed_size); int compress_stream_zstd(int fdf, int fdt, uint64_t max_bytes, uint64_t *ret_uncompressed_size); -int decompress_stream_xz(int fdf, int fdt, uint64_t max_size); -int decompress_stream_lz4(int fdf, int fdt, uint64_t max_size); -int decompress_stream_zstd(int fdf, int fdt, uint64_t max_size); +int decompress_stream_xz(int fdf, int fdt, uint64_t max_bytes); +int decompress_stream_lz4(int fdf, int fdt, uint64_t max_bytes); +int decompress_stream_zstd(int fdf, int fdt, uint64_t max_bytes); int dlopen_lz4(void); int dlopen_zstd(void); diff --git a/src/basic/efivars.h b/src/basic/efivars.h index 93c918847af..eeccbb18067 100644 --- a/src/basic/efivars.h +++ b/src/basic/efivars.h @@ -43,7 +43,7 @@ int efi_get_variable(const char *variable, uint32_t *attribute, void **ret_value int efi_get_variable_string(const char *variable, char **ret); int efi_get_variable_path(const char *variable, char **ret); int efi_set_variable(const char *variable, const void *value, size_t size) _nonnull_if_nonzero_(2, 3); -int efi_set_variable_string(const char *variable, const char *p); +int efi_set_variable_string(const char *variable, const char *value); bool is_efi_boot(void); bool is_efi_secure_boot(void); diff --git a/src/basic/env-util.c b/src/basic/env-util.c index bbb6d5829b5..7964a368db2 100644 --- a/src/basic/env-util.c +++ b/src/basic/env-util.c @@ -605,10 +605,10 @@ int strv_env_get_merged(char **l, char ***ret) { return 0; } -char** strv_env_clean_with_callback(char **e, void (*invalid_callback)(const char *p, void *userdata), void *userdata) { +char** strv_env_clean_with_callback(char **l, void (*invalid_callback)(const char *p, void *userdata), void *userdata) { int k = 0; - STRV_FOREACH(p, e) { + STRV_FOREACH(p, l) { size_t n; bool duplicate = false; @@ -631,13 +631,13 @@ char** strv_env_clean_with_callback(char **e, void (*invalid_callback)(const cha continue; } - e[k++] = *p; + l[k++] = *p; } - if (e) - e[k] = NULL; + if (l) + l[k] = NULL; - return e; + return l; } static int strv_extend_with_length(char ***l, const char *s, size_t n) { diff --git a/src/basic/fd-util.h b/src/basic/fd-util.h index 89741881940..db4b5914380 100644 --- a/src/basic/fd-util.h +++ b/src/basic/fd-util.h @@ -79,7 +79,7 @@ void close_many_and_free(int *fds, size_t n_fds); int fclose_nointr(FILE *f); FILE* safe_fclose(FILE *f); -DIR* safe_closedir(DIR *f); +DIR* safe_closedir(DIR *d); static inline void closep(int *fd) { safe_close(*fd); diff --git a/src/basic/fs-util.c b/src/basic/fs-util.c index 893e95c3c12..6284bb2ddcc 100644 --- a/src/basic/fs-util.c +++ b/src/basic/fs-util.c @@ -528,7 +528,7 @@ int mknodat_atomic(int atfd, const char *path, mode_t mode, dev_t dev) { return 0; } -int mkfifoat_atomic(int atfd, const char *path, mode_t mode) { +int mkfifoat_atomic(int dir_fd, const char *path, mode_t mode) { _cleanup_free_ char *t = NULL; int r; @@ -539,12 +539,12 @@ int mkfifoat_atomic(int atfd, const char *path, mode_t mode) { if (r < 0) return r; - if (mkfifoat(atfd, t, mode) < 0) + if (mkfifoat(dir_fd, t, mode) < 0) return -errno; - r = RET_NERRNO(renameat(atfd, t, atfd, path)); + r = RET_NERRNO(renameat(dir_fd, t, dir_fd, path)); if (r < 0) { - (void) unlinkat(atfd, t, 0); + (void) unlinkat(dir_fd, t, 0); return r; } diff --git a/src/basic/hash-funcs.c b/src/basic/hash-funcs.c index 195256d07d2..5c0af6fe5a3 100644 --- a/src/basic/hash-funcs.c +++ b/src/basic/hash-funcs.c @@ -31,10 +31,10 @@ DEFINE_HASH_OPS_FULL( char, string_hash_func, string_compare_func, free, char*, strv_free); -void path_hash_func(const char *q, struct siphash *state) { +void path_hash_func(const char *p, struct siphash *state) { bool add_slash = false; - assert(q); + assert(p); assert(state); /* Calculates a hash for a path in a way this duplicate inner slashes don't make a differences, and also @@ -43,14 +43,14 @@ void path_hash_func(const char *q, struct siphash *state) { * which begin in a slash or not) will hash differently though. */ /* if path is absolute, add one "/" to the hash. */ - if (path_is_absolute(q)) + if (path_is_absolute(p)) siphash24_compress_byte('/', state); for (;;) { const char *e; int r; - r = path_find_first_component(&q, true, &e); + r = path_find_first_component(&p, true, &e); if (r == 0) return; @@ -59,7 +59,7 @@ void path_hash_func(const char *q, struct siphash *state) { if (r < 0) { /* if a component is invalid, then add remaining part as a string. */ - string_hash_func(q, state); + string_hash_func(p, state); return; } diff --git a/src/basic/hashmap.c b/src/basic/hashmap.c index 6d4c57e81bd..30c0517a57c 100644 --- a/src/basic/hashmap.c +++ b/src/basic/hashmap.c @@ -1372,7 +1372,7 @@ void* _hashmap_get(HashmapBase *h, const void *key) { return entry_value(h, e); } -void* hashmap_get2(Hashmap *h, const void *key, void **key2) { +void* hashmap_get2(Hashmap *h, const void *key, void **ret) { struct plain_hashmap_entry *e; unsigned hash, idx; @@ -1385,8 +1385,8 @@ void* hashmap_get2(Hashmap *h, const void *key, void **key2) { return NULL; e = plain_bucket_at(h, idx); - if (key2) - *key2 = (void*) e->b.key; + if (ret) + *ret = (void*) e->b.key; return e->value; } @@ -1421,29 +1421,29 @@ void* _hashmap_remove(HashmapBase *h, const void *key) { return data; } -void* hashmap_remove2(Hashmap *h, const void *key, void **rkey) { +void* hashmap_remove2(Hashmap *h, const void *key, void **ret) { struct plain_hashmap_entry *e; unsigned hash, idx; void *data; if (!h) { - if (rkey) - *rkey = NULL; + if (ret) + *ret = NULL; return NULL; } hash = bucket_hash(h, key); idx = bucket_scan(h, hash, key); if (idx == IDX_NIL) { - if (rkey) - *rkey = NULL; + if (ret) + *ret = NULL; return NULL; } e = plain_bucket_at(h, idx); data = e->value; - if (rkey) - *rkey = (void*) e->b.key; + if (ret) + *ret = (void*) e->b.key; remove_entry(h, idx); diff --git a/src/basic/hashmap.h b/src/basic/hashmap.h index ea39ffd6b09..df68b0ccf86 100644 --- a/src/basic/hashmap.h +++ b/src/basic/hashmap.h @@ -123,9 +123,9 @@ static inline void *ordered_hashmap_get(OrderedHashmap *h, const void *key) { return _hashmap_get(HASHMAP_BASE(h), key); } -void* hashmap_get2(Hashmap *h, const void *key, void **rkey); -static inline void *ordered_hashmap_get2(OrderedHashmap *h, const void *key, void **rkey) { - return hashmap_get2(PLAIN_HASHMAP(h), key, rkey); +void* hashmap_get2(Hashmap *h, const void *key, void **ret); +static inline void *ordered_hashmap_get2(OrderedHashmap *h, const void *key, void **ret) { + return hashmap_get2(PLAIN_HASHMAP(h), key, ret); } bool _hashmap_contains(HashmapBase *h, const void *key); @@ -144,9 +144,9 @@ static inline void *ordered_hashmap_remove(OrderedHashmap *h, const void *key) { return _hashmap_remove(HASHMAP_BASE(h), key); } -void* hashmap_remove2(Hashmap *h, const void *key, void **rkey); -static inline void *ordered_hashmap_remove2(OrderedHashmap *h, const void *key, void **rkey) { - return hashmap_remove2(PLAIN_HASHMAP(h), key, rkey); +void* hashmap_remove2(Hashmap *h, const void *key, void **ret); +static inline void *ordered_hashmap_remove2(OrderedHashmap *h, const void *key, void **ret) { + return hashmap_remove2(PLAIN_HASHMAP(h), key, ret); } void* _hashmap_remove_value(HashmapBase *h, const void *key, void *value); diff --git a/src/basic/hexdecoct.c b/src/basic/hexdecoct.c index d0f3450e2c7..a00c6289cca 100644 --- a/src/basic/hexdecoct.c +++ b/src/basic/hexdecoct.c @@ -112,7 +112,7 @@ int unhexmem_full( size_t l, bool secure, void **ret_data, - size_t *ret_len) { + size_t *ret_size) { _cleanup_free_ uint8_t *buf = NULL; size_t buf_size; @@ -150,8 +150,8 @@ int unhexmem_full( *z = 0; - if (ret_len) - *ret_len = (size_t) (z - buf); + if (ret_size) + *ret_size = (size_t) (z - buf); if (ret_data) *ret_data = TAKE_PTR(buf); diff --git a/src/basic/hexdecoct.h b/src/basic/hexdecoct.h index 755a0798cdc..1322323ac54 100644 --- a/src/basic/hexdecoct.h +++ b/src/basic/hexdecoct.h @@ -38,7 +38,7 @@ ssize_t base64_append( size_t plen, const void *p, size_t l, - size_t margin, + size_t indent, size_t width); int unbase64mem_full(const char *p, size_t l, bool secure, void **ret_data, size_t *ret_size) _nonnull_if_nonzero_(1, 2); static inline int unbase64mem(const char *p, void **ret_data, size_t *ret_size) { diff --git a/src/basic/locale-util.h b/src/basic/locale-util.h index 1524122e09d..b446ea73ff0 100644 --- a/src/basic/locale-util.h +++ b/src/basic/locale-util.h @@ -27,7 +27,7 @@ typedef enum LocaleVariable { _VARIABLE_LC_INVALID = -EINVAL, } LocaleVariable; -int get_locales(char ***l); +int get_locales(char ***ret); bool locale_is_valid(const char *name); int locale_is_installed(const char *name); diff --git a/src/basic/nulstr-util.h b/src/basic/nulstr-util.h index 370d650a7f7..10235a9e6df 100644 --- a/src/basic/nulstr-util.h +++ b/src/basic/nulstr-util.h @@ -34,5 +34,5 @@ static inline int strv_from_nulstr(char ***ret, const char *nulstr) { return 0; } -int strv_make_nulstr(char * const *l, char **p, size_t *n); +int strv_make_nulstr(char * const *l, char **ret, size_t *ret_size); int set_make_nulstr(Set *s, char **ret, size_t *ret_size); diff --git a/src/basic/parse-util.c b/src/basic/parse-util.c index d6eff8e81c3..60833d3b06c 100644 --- a/src/basic/parse-util.c +++ b/src/basic/parse-util.c @@ -685,10 +685,10 @@ int parse_fractional_part_u(const char **p, size_t digits, unsigned *res) { return 0; } -int parse_nice(const char *p, int *ret) { +int parse_nice(const char *s, int *ret) { int n, r; - r = safe_atoi(p, &n); + r = safe_atoi(s, &n); if (r < 0) return r; diff --git a/src/basic/parse-util.h b/src/basic/parse-util.h index 39add96ec77..153553773dd 100644 --- a/src/basic/parse-util.h +++ b/src/basic/parse-util.h @@ -22,7 +22,7 @@ int parse_errno(const char *t); int parse_fd(const char *t); int parse_user_shell(const char *s, char **ret_sh, bool *ret_copy); -int parse_capability_set(const char *s, uint64_t initial, uint64_t *capability_set); +int parse_capability_set(const char *s, uint64_t initial, uint64_t *current); #define SAFE_ATO_REFUSE_PLUS_MINUS (1U << 30) #define SAFE_ATO_REFUSE_LEADING_ZERO (1U << 29) @@ -38,7 +38,7 @@ static inline int safe_atou(const char *s, unsigned *ret_u) { int safe_atou_bounded(const char *s, unsigned min, unsigned max, unsigned *ret); int safe_atoi(const char *s, int *ret_i); -int safe_atolli(const char *s, long long *ret_i); +int safe_atolli(const char *s, long long *ret_lli); int safe_atou8_full(const char *s, unsigned base, uint8_t *ret); @@ -131,9 +131,9 @@ static inline int safe_atozu(const char *s, size_t *ret_u) { int safe_atod(const char *s, double *ret_d); -int parse_fractional_part_u(const char **s, size_t digits, unsigned *res); +int parse_fractional_part_u(const char **p, size_t digits, unsigned *res); -int parse_nice(const char *p, int *ret); +int parse_nice(const char *s, int *ret); int parse_ip_port(const char *s, uint16_t *ret); int parse_ip_port_range(const char *s, uint16_t *low, uint16_t *high, bool allow_zero); diff --git a/src/basic/pidref.h b/src/basic/pidref.h index 8280910f5d9..c9185afd8d8 100644 --- a/src/basic/pidref.h +++ b/src/basic/pidref.h @@ -96,7 +96,7 @@ int pidref_kill(const PidRef *pidref, int sig); int pidref_kill_and_sigcont(const PidRef *pidref, int sig); int pidref_sigqueue(const PidRef *pidref, int sig, int value); -int pidref_wait(PidRef *pidref, siginfo_t *siginfo, int options); +int pidref_wait(PidRef *pidref, siginfo_t *ret, int options); int pidref_wait_for_terminate(PidRef *pidref, siginfo_t *ret); static inline void pidref_done_sigkill_wait(PidRef *pidref) { diff --git a/src/basic/proc-cmdline.h b/src/basic/proc-cmdline.h index 67f31793ad7..42a8ef1eb9c 100644 --- a/src/basic/proc-cmdline.h +++ b/src/basic/proc-cmdline.h @@ -19,7 +19,7 @@ int proc_cmdline_strv(char ***ret); int proc_cmdline_parse(proc_cmdline_parse_t parse, void *userdata, ProcCmdlineFlags flags); -int proc_cmdline_get_key(const char *parameter, ProcCmdlineFlags flags, char **ret_value); +int proc_cmdline_get_key(const char *key, ProcCmdlineFlags flags, char **ret_value); int proc_cmdline_get_bool(const char *key, ProcCmdlineFlags flags, bool *ret); int proc_cmdline_get_key_many_internal(ProcCmdlineFlags flags, ...); diff --git a/src/basic/process-util.h b/src/basic/process-util.h index 66ec4fa031c..9217eebc8b5 100644 --- a/src/basic/process-util.h +++ b/src/basic/process-util.h @@ -86,7 +86,7 @@ int kill_and_sigcont(pid_t pid, int sig); int pid_is_kernel_thread(pid_t pid); int pidref_is_kernel_thread(const PidRef *pid); -int getenv_for_pid(pid_t pid, const char *field, char **_value); +int getenv_for_pid(pid_t pid, const char *field, char **ret); int pid_is_alive(pid_t pid); int pidref_is_alive(const PidRef *pidref); @@ -121,7 +121,7 @@ int opinionated_personality(unsigned long *ret); const char* sigchld_code_to_string(int i) _const_; int sigchld_code_from_string(const char *s) _pure_; -int sched_policy_to_string_alloc(int i, char **s); +int sched_policy_to_string_alloc(int i, char **ret); int sched_policy_from_string(const char *s); static inline pid_t PTR_TO_PID(const void *p) { diff --git a/src/basic/procfs-util.h b/src/basic/procfs-util.h index 560be323dcd..a33383358e3 100644 --- a/src/basic/procfs-util.h +++ b/src/basic/procfs-util.h @@ -16,4 +16,4 @@ static inline int procfs_memory_get_used(uint64_t *ret) { return procfs_memory_get(NULL, ret); } -int convert_meminfo_value_to_uint64_bytes(const char *word, uint64_t *ret); +int convert_meminfo_value_to_uint64_bytes(const char *s, uint64_t *ret); diff --git a/src/basic/sha256.h b/src/basic/sha256.h index afcb5810dc1..5016cb42b02 100644 --- a/src/basic/sha256.h +++ b/src/basic/sha256.h @@ -7,6 +7,6 @@ int sha256_fd(int fd, uint64_t max_size, uint8_t ret[static SHA256_DIGEST_SIZE]); -int parse_sha256(const char *s, uint8_t res[static SHA256_DIGEST_SIZE]); +int parse_sha256(const char *s, uint8_t ret[static SHA256_DIGEST_SIZE]); bool sha256_is_valid(const char *s) _pure_; diff --git a/src/basic/signal-util.c b/src/basic/signal-util.c index bd7d88f28fa..2e5f7f24494 100644 --- a/src/basic/signal-util.c +++ b/src/basic/signal-util.c @@ -89,7 +89,7 @@ int sigset_add_many_internal(sigset_t *ss, ...) { return r; } -int sigprocmask_many_internal(int how, sigset_t *old, ...) { +int sigprocmask_many_internal(int how, sigset_t *ret_old_mask, ...) { va_list ap; sigset_t ss; int r; @@ -97,14 +97,14 @@ int sigprocmask_many_internal(int how, sigset_t *old, ...) { if (sigemptyset(&ss) < 0) return -errno; - va_start(ap, old); + va_start(ap, ret_old_mask); r = sigset_add_many_ap(&ss, ap); va_end(ap); if (r < 0) return r; - return RET_NERRNO(sigprocmask(how, &ss, old)); + return RET_NERRNO(sigprocmask(how, &ss, ret_old_mask)); } static const char *const static_signal_table[] = { diff --git a/src/basic/signal-util.h b/src/basic/signal-util.h index f529abcd724..78c4ae4c569 100644 --- a/src/basic/signal-util.h +++ b/src/basic/signal-util.h @@ -31,7 +31,7 @@ int sigset_add_many_internal(sigset_t *ss, ...); int sigprocmask_many_internal(int how, sigset_t *ret_old_mask, ...); #define sigprocmask_many(...) sigprocmask_many_internal(__VA_ARGS__, -1) -const char* signal_to_string(int i) _const_; +const char* signal_to_string(int signo) _const_; int signal_from_string(const char *s) _pure_; void nop_signal_handler(int sig); diff --git a/src/basic/socket-util.h b/src/basic/socket-util.h index b8cb834131e..69b2409d4b3 100644 --- a/src/basic/socket-util.h +++ b/src/basic/socket-util.h @@ -67,7 +67,7 @@ static inline int socket_address_unlink(const SocketAddress *a) { bool socket_address_can_accept(const SocketAddress *a) _pure_; int socket_address_verify(const SocketAddress *a, bool strict) _pure_; -int socket_address_print(const SocketAddress *a, char **p); +int socket_address_print(const SocketAddress *a, char **ret); bool socket_address_matches_fd(const SocketAddress *a, int fd); bool socket_address_equal(const SocketAddress *a, const SocketAddress *b) _pure_; @@ -87,7 +87,7 @@ int getsockname_pretty(int fd, char **ret); int socknameinfo_pretty(const struct sockaddr *sa, socklen_t salen, char **_ret); -int netlink_family_to_string_alloc(int b, char **s); +int netlink_family_to_string_alloc(int i, char **ret); int netlink_family_from_string(const char *s) _pure_; bool sockaddr_equal(const union sockaddr_union *a, const union sockaddr_union *b); @@ -101,7 +101,7 @@ static inline int fd_increase_rxbuf(int fd, size_t n) { return fd_set_rcvbuf(fd, n, true); } -int ip_tos_to_string_alloc(int i, char **s); +int ip_tos_to_string_alloc(int i, char **ret); int ip_tos_from_string(const char *s); typedef enum { diff --git a/src/basic/string-table.h b/src/basic/string-table.h index 11f57d6fed1..1a2a6005022 100644 --- a/src/basic/string-table.h +++ b/src/basic/string-table.h @@ -14,9 +14,10 @@ int string_table_lookup_to_string_fallback(const char * const *table, size_t len ssize_t string_table_lookup_from_string_fallback(const char * const *table, size_t len, const char *s, size_t max); /* For basic lookup tables with strictly enumerated entries */ -#define _DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name, type, scope) \ - scope const char* name##_to_string(type i) { \ - return string_table_lookup_to_string(name##_table, ELEMENTSOF(name##_table), i); \ +#define _DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name, type, scope) \ + /* NOLINTNEXTLINE (readability-inconsistent-declaration-parameter-name) */ \ + scope const char* name##_to_string(type i) { \ + return string_table_lookup_to_string(name##_table, ELEMENTSOF(name##_table), i); \ } #define _DEFINE_STRING_TABLE_LOOKUP_FROM_STRING(name, type, scope) \ @@ -29,8 +30,9 @@ ssize_t string_table_lookup_from_string_fallback(const char * const *table, size return (type) string_table_lookup_from_string_with_boolean(name##_table, ELEMENTSOF(name##_table), s, yes); \ } -#define _DEFINE_STRING_TABLE_LOOKUP_TO_STRING_FALLBACK(name, type, max, scope) \ - scope int name##_to_string_alloc(type i, char **ret) { \ +#define _DEFINE_STRING_TABLE_LOOKUP_TO_STRING_FALLBACK(name, type, max, scope) \ + /* NOLINTNEXTLINE (readability-inconsistent-declaration-parameter-name) */ \ + scope int name##_to_string_alloc(type i, char **ret) { \ return string_table_lookup_to_string_fallback(name##_table, ELEMENTSOF(name##_table), i, max, ret); \ } diff --git a/src/basic/string-util.c b/src/basic/string-util.c index 6e7da6f0bd6..cbdc8c3e968 100644 --- a/src/basic/string-util.c +++ b/src/basic/string-util.c @@ -144,32 +144,32 @@ char ascii_toupper(char x) { return x; } -char* ascii_strlower(char *t) { - assert(t); +char* ascii_strlower(char *s) { + assert(s); - for (char *p = t; *p; p++) + for (char *p = s; *p; p++) *p = ascii_tolower(*p); - return t; + return s; } -char* ascii_strupper(char *t) { - assert(t); +char* ascii_strupper(char *s) { + assert(s); - for (char *p = t; *p; p++) + for (char *p = s; *p; p++) *p = ascii_toupper(*p); - return t; + return s; } -char* ascii_strlower_n(char *t, size_t n) { +char* ascii_strlower_n(char *s, size_t n) { if (n <= 0) - return t; + return s; for (size_t i = 0; i < n; i++) - t[i] = ascii_tolower(t[i]); + s[i] = ascii_tolower(s[i]); - return t; + return s; } int ascii_strcasecmp_n(const char *a, const char *b, size_t n) { diff --git a/src/basic/strv.c b/src/basic/strv.c index 5e0fabc3c5e..34d1e96b632 100644 --- a/src/basic/strv.c +++ b/src/basic/strv.c @@ -159,17 +159,17 @@ void strv_free_many(char ***strvs, size_t n) { free(strvs); } -char** strv_copy_n(char * const *l, size_t m) { +char** strv_copy_n(char * const *l, size_t n) { _cleanup_strv_free_ char **result = NULL; char **k; - result = new(char*, MIN(strv_length(l), m) + 1); + result = new(char*, MIN(strv_length(l), n) + 1); if (!result) return NULL; k = result; STRV_FOREACH(i, l) { - if (m == 0) + if (n == 0) break; *k = strdup(*i); @@ -177,8 +177,8 @@ char** strv_copy_n(char * const *l, size_t m) { return NULL; k++; - if (m != SIZE_MAX) - m--; + if (n != SIZE_MAX) + n--; } *k = NULL; diff --git a/src/basic/sysctl-util.h b/src/basic/sysctl-util.h index 4055d0181f9..febbb233d4c 100644 --- a/src/basic/sysctl-util.h +++ b/src/basic/sysctl-util.h @@ -6,7 +6,7 @@ #include "stdio-util.h" char* sysctl_normalize(char *s); -int sysctl_read(const char *property, char **value); +int sysctl_read(const char *property, char **ret); int sysctl_write_full(const char *property, const char *value, Hashmap **shadow); int sysctl_writef(const char *property, const char *format, ...) _printf_(2, 3); static inline int sysctl_write(const char *property, const char *value) { diff --git a/src/basic/syslog-util.h b/src/basic/syslog-util.h index 215b175b0d9..b4bad9fca92 100644 --- a/src/basic/syslog-util.h +++ b/src/basic/syslog-util.h @@ -3,11 +3,11 @@ #include "basic-forward.h" -int log_facility_unshifted_to_string_alloc(int i, char **s); +int log_facility_unshifted_to_string_alloc(int i, char **ret); int log_facility_unshifted_from_string(const char *s); bool log_facility_unshifted_is_valid(int faciliy); -int log_level_to_string_alloc(int i, char **s); +int log_level_to_string_alloc(int i, char **ret); int log_level_from_string(const char *s); bool log_level_is_valid(int level); diff --git a/src/basic/terminal-util.h b/src/basic/terminal-util.h index 48cce67833f..d6342a45b77 100644 --- a/src/basic/terminal-util.h +++ b/src/basic/terminal-util.h @@ -86,16 +86,16 @@ int proc_cmdline_tty_size(const char *tty, unsigned *ret_rows, unsigned *ret_col int chvt(int vt); int read_one_char(FILE *f, char *ret, usec_t timeout, bool echo, bool *need_nl); -int ask_char(char *ret, const char *replies, const char *text, ...) _printf_(3, 4); +int ask_char(char *ret, const char *replies, const char *fmt, ...) _printf_(3, 4); typedef int (*GetCompletionsCallback)(const char *key, char ***ret_list, void *userdata); -int ask_string_full(char **ret, GetCompletionsCallback cb, void *userdata, const char *text, ...) _printf_(4, 5); +int ask_string_full(char **ret, GetCompletionsCallback get_completions, void *userdata, const char *text, ...) _printf_(4, 5); #define ask_string(ret, text, ...) ask_string_full(ret, NULL, NULL, text, ##__VA_ARGS__) bool any_key_to_proceed(void); int show_menu(char **x, size_t n_columns, size_t column_width, unsigned ellipsize_percentage, const char *grey_prefix, bool with_numbers); -int vt_disallocate(const char *name); +int vt_disallocate(const char *tty_path); int resolve_dev_console(char **ret); int get_kernel_consoles(char ***ret); diff --git a/src/basic/unit-def.h b/src/basic/unit-def.h index 37539ef0189..be2d6e1af66 100644 --- a/src/basic/unit-def.h +++ b/src/basic/unit-def.h @@ -325,7 +325,7 @@ UnitActiveState unit_active_state_from_string(const char *s) _pure_; const char* freezer_state_to_string(FreezerState i) _const_; FreezerState freezer_state_from_string(const char *s) _pure_; -FreezerState freezer_state_finish(FreezerState i) _const_; +FreezerState freezer_state_finish(FreezerState state) _const_; FreezerState freezer_state_objective(FreezerState state) _const_; const char* unit_marker_to_string(UnitMarker m) _const_; diff --git a/src/basic/unit-name.h b/src/basic/unit-name.h index 334877c2f2e..e454d0a86db 100644 --- a/src/basic/unit-name.h +++ b/src/basic/unit-name.h @@ -67,7 +67,7 @@ static inline int unit_name_mangle(const char *name, UnitNameMangle flags, char } int slice_build_parent_slice(const char *slice, char **ret); -int slice_build_subslice(const char *slice, const char *name, char **subslice); +int slice_build_subslice(const char *slice, const char *name, char **ret); bool slice_name_is_valid(const char *name); bool unit_name_prefix_equal(const char *a, const char *b); diff --git a/src/basic/user-util.h b/src/basic/user-util.h index e2486e5a69c..003420dbe3b 100644 --- a/src/basic/user-util.h +++ b/src/basic/user-util.h @@ -71,7 +71,7 @@ char* gid_to_name(gid_t gid); int in_gid(gid_t gid); int in_group(const char *name); -int merge_gid_lists(const gid_t *list1, size_t size1, const gid_t *list2, size_t size2, gid_t **result); +int merge_gid_lists(const gid_t *list1, size_t size1, const gid_t *list2, size_t size2, gid_t **ret); int getgroups_alloc(gid_t **ret); int get_home_dir(char **ret); diff --git a/src/boot/boot.c b/src/boot/boot.c index a167f736349..5df8a6ed565 100644 --- a/src/boot/boot.c +++ b/src/boot/boot.c @@ -1607,7 +1607,7 @@ static void config_load_type1_entries( /* offset= */ 0, /* size= */ 0, &content, - /* content_size= */ NULL); + /* ret_size= */ NULL); if (err != EFI_SUCCESS) continue; diff --git a/src/boot/chid.h b/src/boot/chid.h index fcc4464539f..f8299fde888 100644 --- a/src/boot/chid.h +++ b/src/boot/chid.h @@ -98,4 +98,8 @@ static inline const char* device_get_fwid(const void *base, const Device *device return off == 0 ? NULL : (const char *) ((const uint8_t *) base + off); } -EFI_STATUS chid_match(const void *chids_buffer, size_t chids_length, uint32_t match_type, const Device **ret_device); +EFI_STATUS chid_match( + const void *hwid_buffer, + size_t hwid_length, + uint32_t match_type, + const Device **ret_device); diff --git a/src/boot/efi-string-table.h b/src/boot/efi-string-table.h index 666d849e0a4..ba2a0d365e1 100644 --- a/src/boot/efi-string-table.h +++ b/src/boot/efi-string-table.h @@ -4,10 +4,11 @@ #include "efi-string.h" #include "macro-fundamental.h" -#define _DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name,type,scope) \ - scope const char* name##_to_string(type i) { \ - assert(i >= 0 && i < (type) ELEMENTSOF(name##_table)); \ - return name##_table[i]; \ +#define _DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name,type,scope) \ + /* NOLINTNEXTLINE (readability-inconsistent-declaration-parameter-name) */ \ + scope const char* name##_to_string(type i) { \ + assert(i >= 0 && i < (type) ELEMENTSOF(name##_table)); \ + return name##_table[i]; \ } #define _DEFINE_STRING_TABLE_LOOKUP_FROM_STRING(name, type, scope) \ diff --git a/src/boot/measure.h b/src/boot/measure.h index 4ceed0e0f81..3d837f27ec4 100644 --- a/src/boot/measure.h +++ b/src/boot/measure.h @@ -21,7 +21,7 @@ char *description, bool *ret_measured); /* New stuff is logged as EV_EVENT_TAG */ EFI_STATUS tpm_log_tagged_event(uint32_t pcrindex, EFI_PHYSICAL_ADDRESS buffer, size_t buffer_size, uint32_t event_id, const char16_t *description, bool *ret_measured); -EFI_STATUS tpm_log_load_options(const char16_t *cmdline, bool *ret_measured); +EFI_STATUS tpm_log_load_options(const char16_t *load_options, bool *ret_measured); #else @@ -51,7 +51,7 @@ static inline EFI_STATUS tpm_log_tagged_event(uint32_t pcrindex, EFI_PHYSICAL_AD return EFI_SUCCESS; } -static inline EFI_STATUS tpm_log_load_options(const char16_t *cmdline, bool *ret_measured) { +static inline EFI_STATUS tpm_log_load_options(const char16_t *load_options, bool *ret_measured) { if (ret_measured) *ret_measured = false; return EFI_SUCCESS; diff --git a/src/boot/util.c b/src/boot/util.c index 92da63fc0ff..63bf21ae50f 100644 --- a/src/boot/util.c +++ b/src/boot/util.c @@ -324,14 +324,14 @@ bool is_ascii(const char16_t *f) { return true; } -char16_t **strv_free(char16_t **v) { - if (!v) +char16_t **strv_free(char16_t **l) { + if (!l) return NULL; - for (char16_t **i = v; *i; i++) + for (char16_t **i = l; *i; i++) free(*i); - return mfree(v); + return mfree(l); } EFI_STATUS open_directory( diff --git a/src/boot/util.h b/src/boot/util.h index 2be8d463c35..59f61c6c39e 100644 --- a/src/boot/util.h +++ b/src/boot/util.h @@ -126,11 +126,11 @@ static inline Pages xmalloc_initrd_pages(size_t n_pages) { } void convert_efi_path(char16_t *path); -char16_t *xstr8_to_path(const char *stra); +char16_t *xstr8_to_path(const char *str8); char16_t *mangle_stub_cmdline(char16_t *cmdline); EFI_STATUS chunked_read(EFI_FILE *file, size_t *size, void *buf); -EFI_STATUS file_read(EFI_FILE *dir, const char16_t *name, uint64_t offset, size_t size, char **content, size_t *content_size); +EFI_STATUS file_read(EFI_FILE *dir, const char16_t *name, uint64_t offset, size_t size, char **ret, size_t *ret_size); EFI_STATUS file_handle_read(EFI_FILE *handle, uint64_t offset, size_t size, char **ret, size_t *ret_size); static inline void file_closep(EFI_FILE **handle) { diff --git a/src/core/crash-handler.h b/src/core/crash-handler.h index b00991ae073..2fad083ace3 100644 --- a/src/core/crash-handler.h +++ b/src/core/crash-handler.h @@ -12,7 +12,7 @@ typedef enum CrashAction { } CrashAction; const char* crash_action_to_string(CrashAction action); -CrashAction crash_action_from_string(const char *action); +CrashAction crash_action_from_string(const char *s); _noreturn_ void freeze_or_exit_or_reboot(void); void install_crash_handler(void); diff --git a/src/core/dbus-path.c b/src/core/dbus-path.c index 22f6209ac91..c4deaaf833b 100644 --- a/src/core/dbus-path.c +++ b/src/core/dbus-path.c @@ -148,7 +148,7 @@ int bus_path_set_property( Unit *u, const char *name, sd_bus_message *message, - UnitWriteFlags mode, + UnitWriteFlags flags, sd_bus_error *reterr_error) { Path *p = PATH(u); @@ -158,7 +158,7 @@ int bus_path_set_property( assert(message); if (u->transient && u->load_state == UNIT_STUB) - return bus_path_set_transient_property(p, name, message, mode, reterr_error); + return bus_path_set_transient_property(p, name, message, flags, reterr_error); return 0; } diff --git a/src/core/dbus-timer.c b/src/core/dbus-timer.c index 98fd8e5c5e4..1bf22e8c05c 100644 --- a/src/core/dbus-timer.c +++ b/src/core/dbus-timer.c @@ -358,7 +358,7 @@ int bus_timer_set_property( Unit *u, const char *name, sd_bus_message *message, - UnitWriteFlags mode, + UnitWriteFlags flags, sd_bus_error *reterr_error) { Timer *t = TIMER(u); @@ -368,7 +368,7 @@ int bus_timer_set_property( assert(message); if (u->transient && u->load_state == UNIT_STUB) - return bus_timer_set_transient_property(t, name, message, mode, reterr_error); + return bus_timer_set_transient_property(t, name, message, flags, reterr_error); return 0; } diff --git a/src/core/exec-credential.h b/src/core/exec-credential.h index b712b71e6e6..056e5173588 100644 --- a/src/core/exec-credential.h +++ b/src/core/exec-credential.h @@ -29,7 +29,7 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(ExecSetCredential*, exec_set_credential_free); ExecLoadCredential* exec_load_credential_free(ExecLoadCredential *lc); DEFINE_TRIVIAL_CLEANUP_FUNC(ExecLoadCredential*, exec_load_credential_free); -ExecImportCredential* exec_import_credential_free(ExecImportCredential *lc); +ExecImportCredential* exec_import_credential_free(ExecImportCredential *ic); DEFINE_TRIVIAL_CLEANUP_FUNC(ExecImportCredential*, exec_import_credential_free); int exec_context_put_load_credential(ExecContext *c, const char *id, const char *path, bool encrypted); @@ -51,7 +51,7 @@ int exec_context_get_credential_directory( const char *unit, char **ret); -int exec_context_destroy_credentials(const ExecContext *c, const char *runtime_root, const char *unit); +int exec_context_destroy_credentials(const ExecContext *c, const char *runtime_prefix, const char *unit); int exec_setup_credentials( const ExecContext *context, diff --git a/src/core/execute.c b/src/core/execute.c index 29a4f692913..08210edb1e8 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -465,7 +465,7 @@ static void log_command_line(Unit *unit, const char *msg, const char *executable LOG_UNIT_INVOCATION_ID(unit)); } -static int exec_context_load_environment(const Unit *unit, const ExecContext *c, char ***l); +static int exec_context_load_environment(const Unit *unit, const ExecContext *c, char ***ret); int exec_spawn( Unit *unit, diff --git a/src/core/execute.h b/src/core/execute.h index 7b6ace99b3e..42127347cf6 100644 --- a/src/core/execute.h +++ b/src/core/execute.h @@ -508,7 +508,7 @@ void exec_context_init(ExecContext *c); void exec_context_done(ExecContext *c); void exec_context_dump(const ExecContext *c, FILE* f, const char *prefix); -int exec_context_destroy_runtime_directory(const ExecContext *c, const char *runtime_root); +int exec_context_destroy_runtime_directory(const ExecContext *c, const char *runtime_prefix); int exec_context_destroy_mount_ns_dir(Unit *u); const char* exec_context_fdname(const ExecContext *c, int fd_index) _pure_; @@ -557,7 +557,7 @@ void exec_status_handoff(ExecStatus *s, const struct ucred *ucred, const dual_ti void exec_status_dump(const ExecStatus *s, FILE *f, const char *prefix); void exec_status_reset(ExecStatus *s); -int exec_shared_runtime_acquire(Manager *m, const ExecContext *c, const char *name, bool create, ExecSharedRuntime **ret); +int exec_shared_runtime_acquire(Manager *m, const ExecContext *c, const char *id, bool create, ExecSharedRuntime **ret); ExecSharedRuntime *exec_shared_runtime_destroy(ExecSharedRuntime *r); ExecSharedRuntime *exec_shared_runtime_unref(ExecSharedRuntime *r); DEFINE_TRIVIAL_CLEANUP_FUNC(ExecSharedRuntime*, exec_shared_runtime_unref); diff --git a/src/core/manager-dump.c b/src/core/manager-dump.c index 02275bb7ec5..1d9d9c6bdfb 100644 --- a/src/core/manager-dump.c +++ b/src/core/manager-dump.c @@ -15,13 +15,13 @@ #include "unit-serialize.h" #include "version.h" -void manager_dump_jobs(Manager *s, FILE *f, char **patterns, const char *prefix) { +void manager_dump_jobs(Manager *m, FILE *f, char **patterns, const char *prefix) { Job *j; - assert(s); + assert(m); assert(f); - HASHMAP_FOREACH(j, s->jobs) { + HASHMAP_FOREACH(j, m->jobs) { if (!strv_fnmatch_or_empty(patterns, j->unit->id, FNM_NOESCAPE)) continue; @@ -46,14 +46,14 @@ int manager_get_dump_jobs_string(Manager *m, char **patterns, const char *prefix return memstream_finalize(&ms, ret, NULL); } -void manager_dump_units(Manager *s, FILE *f, char **patterns, const char *prefix) { +void manager_dump_units(Manager *m, FILE *f, char **patterns, const char *prefix) { Unit *u; const char *t; - assert(s); + assert(m); assert(f); - HASHMAP_FOREACH_KEY(u, t, s->units) { + HASHMAP_FOREACH_KEY(u, t, m->units) { if (u->id != t) continue; diff --git a/src/core/manager-dump.h b/src/core/manager-dump.h index a6dca29711f..4c9373c40e9 100644 --- a/src/core/manager-dump.h +++ b/src/core/manager-dump.h @@ -3,9 +3,9 @@ #include "core-forward.h" -void manager_dump_jobs(Manager *s, FILE *f, char **patterns, const char *prefix); +void manager_dump_jobs(Manager *m, FILE *f, char **patterns, const char *prefix); int manager_get_dump_jobs_string(Manager *m, char **patterns, const char *prefix, char **ret); -void manager_dump_units(Manager *s, FILE *f, char **patterns, const char *prefix); -void manager_dump(Manager *s, FILE *f, char **patterns, const char *prefix); +void manager_dump_units(Manager *m, FILE *f, char **patterns, const char *prefix); +void manager_dump(Manager *m, FILE *f, char **patterns, const char *prefix); int manager_get_dump_string(Manager *m, char **patterns, char **ret); void manager_test_summary(Manager *m); diff --git a/src/core/manager.h b/src/core/manager.h index 99b93ebc5a4..90163d5842e 100644 --- a/src/core/manager.h +++ b/src/core/manager.h @@ -514,7 +514,7 @@ static inline usec_t manager_default_timeout_abort_usec(Manager *m) { usec_t manager_default_timeout(RuntimeScope scope); -int manager_new(RuntimeScope scope, ManagerTestRunFlags test_run_flags, Manager **m); +int manager_new(RuntimeScope scope, ManagerTestRunFlags test_run_flags, Manager **ret); Manager* manager_free(Manager *m); DEFINE_TRIVIAL_CLEANUP_FUNC(Manager*, manager_free); diff --git a/src/core/show-status.c b/src/core/show-status.c index 8ba1ae11d3f..0407675aaf3 100644 --- a/src/core/show-status.c +++ b/src/core/show-status.c @@ -22,16 +22,16 @@ static const char* const show_status_table[_SHOW_STATUS_MAX] = { DEFINE_STRING_TABLE_LOOKUP_WITH_BOOLEAN(show_status, ShowStatus, SHOW_STATUS_YES); -int parse_show_status(const char *v, ShowStatus *ret) { - ShowStatus s; +int parse_show_status(const char *s, ShowStatus *ret) { + ShowStatus status; assert(ret); - s = show_status_from_string(v); - if (s < 0 || s == SHOW_STATUS_TEMPORARY) + status = show_status_from_string(s); + if (status < 0 || status == SHOW_STATUS_TEMPORARY) return -EINVAL; - *ret = s; + *ret = status; return 0; } diff --git a/src/core/show-status.h b/src/core/show-status.h index cc58a191f72..13c42078d9c 100644 --- a/src/core/show-status.h +++ b/src/core/show-status.h @@ -31,11 +31,11 @@ typedef enum StatusUnitFormat { static inline bool show_status_on(ShowStatus s) { return IN_SET(s, SHOW_STATUS_TEMPORARY, SHOW_STATUS_YES); } -ShowStatus show_status_from_string(const char *v) _const_; +ShowStatus show_status_from_string(const char *s) _const_; const char* show_status_to_string(ShowStatus s) _pure_; -int parse_show_status(const char *v, ShowStatus *ret); +int parse_show_status(const char *s, ShowStatus *ret); -StatusUnitFormat status_unit_format_from_string(const char *v) _const_; +StatusUnitFormat status_unit_format_from_string(const char *s) _const_; const char* status_unit_format_to_string(StatusUnitFormat s) _pure_; int status_vprintf(const char *status, ShowStatusFlags flags, const char *format, va_list ap) _printf_(3,0); diff --git a/src/core/socket.c b/src/core/socket.c index 897a3289159..4d904f6f093 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -3683,25 +3683,25 @@ static const char* const socket_timestamping_table[_SOCKET_TIMESTAMPING_MAX] = { DEFINE_STRING_TABLE_LOOKUP(socket_timestamping, SocketTimestamping); -SocketTimestamping socket_timestamping_from_string_harder(const char *p) { +SocketTimestamping socket_timestamping_from_string_harder(const char *s) { SocketTimestamping t; int r; - if (!p) + if (!s) return _SOCKET_TIMESTAMPING_INVALID; - t = socket_timestamping_from_string(p); + t = socket_timestamping_from_string(s); if (t >= 0) return t; /* Let's alternatively support the various other aliases parse_time() accepts for ns and µs here, * too. */ - if (streq(p, "nsec")) + if (streq(s, "nsec")) return SOCKET_TIMESTAMPING_NS; - if (STR_IN_SET(p, "usec", "µs", "μs")) /* Accept both small greek letter mu + micro sign unicode codepoints */ + if (STR_IN_SET(s, "usec", "µs", "μs")) /* Accept both small greek letter mu + micro sign unicode codepoints */ return SOCKET_TIMESTAMPING_US; - r = parse_boolean(p); + r = parse_boolean(s); if (r < 0) return _SOCKET_TIMESTAMPING_INVALID; diff --git a/src/core/socket.h b/src/core/socket.h index 74356e2325e..57c9be46239 100644 --- a/src/core/socket.h +++ b/src/core/socket.h @@ -181,7 +181,7 @@ typedef struct Socket { SocketPeer *socket_peer_ref(SocketPeer *p); SocketPeer *socket_peer_unref(SocketPeer *p); -int socket_acquire_peer(Socket *s, int fd, SocketPeer **p); +int socket_acquire_peer(Socket *s, int fd, SocketPeer **ret); DEFINE_TRIVIAL_CLEANUP_FUNC(SocketPeer*, socket_peer_unref); @@ -196,7 +196,7 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(SocketPort*, socket_port_free); void socket_free_ports(Socket *s); -int socket_port_to_address(const SocketPort *s, char **ret); +int socket_port_to_address(const SocketPort *p, char **ret); int socket_load_service_unit(Socket *s, int cfd, Unit **ret); @@ -211,11 +211,11 @@ const char* socket_result_to_string(SocketResult i) _const_; SocketResult socket_result_from_string(const char *s) _pure_; const char* socket_port_type_to_string(SocketPort *p) _pure_; -SocketType socket_port_type_from_string(const char *p) _pure_; +SocketType socket_port_type_from_string(const char *s) _pure_; const char* socket_timestamping_to_string(SocketTimestamping p) _const_; -SocketTimestamping socket_timestamping_from_string(const char *p) _pure_; -SocketTimestamping socket_timestamping_from_string_harder(const char *p) _pure_; +SocketTimestamping socket_timestamping_from_string(const char *s) _pure_; +SocketTimestamping socket_timestamping_from_string_harder(const char *s) _pure_; const char* socket_defer_trigger_to_string(SocketDeferTrigger i) _const_; SocketDeferTrigger socket_defer_trigger_from_string(const char *s) _pure_; diff --git a/src/core/unit-printf.c b/src/core/unit-printf.c index 7c8bf991507..473f7c7d20d 100644 --- a/src/core/unit-printf.c +++ b/src/core/unit-printf.c @@ -142,7 +142,7 @@ static int specifier_shared_data_dir(char specifier, const void *data, const cha return sd_path_lookup(MANAGER_IS_SYSTEM(u->manager) ? SD_PATH_SYSTEM_SHARED : SD_PATH_USER_SHARED, NULL, ret); } -int unit_name_printf(const Unit *u, const char* format, char **ret) { +int unit_name_printf(const Unit *u, const char *format, char **ret) { /* * This will use the passed string as format string and replace the following specifiers (which should all be * safe for inclusion in unit names): diff --git a/src/core/unit-printf.h b/src/core/unit-printf.h index aa9ba004945..467a820aac6 100644 --- a/src/core/unit-printf.h +++ b/src/core/unit-printf.h @@ -3,8 +3,8 @@ #include "core-forward.h" -int unit_name_printf(const Unit *u, const char* text, char **ret); -int unit_full_printf_full(const Unit *u, const char *text, size_t max_length, char **ret); +int unit_name_printf(const Unit *u, const char *format, char **ret); +int unit_full_printf_full(const Unit *u, const char *format, size_t max_length, char **ret); int unit_full_printf(const Unit *u, const char *text, char **ret); int unit_path_printf(const Unit *u, const char *text, char **ret); int unit_fd_printf(const Unit *u, const char *text, char **ret); diff --git a/src/core/unit-serialize.h b/src/core/unit-serialize.h index 8f12c8c991b..8b92d650b2d 100644 --- a/src/core/unit-serialize.h +++ b/src/core/unit-serialize.h @@ -6,7 +6,7 @@ /* These functions serialize state for our own usage, i.e.: across a reload/reexec, rather than for being * passed to a child process. */ -int unit_serialize_state(Unit *u, FILE *f, FDSet *fds, bool serialize_jobs); +int unit_serialize_state(Unit *u, FILE *f, FDSet *fds, bool switching_root); int unit_deserialize_state(Unit *u, FILE *f, FDSet *fds); int unit_deserialize_state_skip(FILE *f); diff --git a/src/core/unit.h b/src/core/unit.h index 72f30227611..b3e0f95e996 100644 --- a/src/core/unit.h +++ b/src/core/unit.h @@ -163,10 +163,10 @@ typedef struct ActivationDetails { ActivationDetails *activation_details_new(Unit *trigger_unit); ActivationDetails *activation_details_ref(ActivationDetails *p); ActivationDetails *activation_details_unref(ActivationDetails *p); -void activation_details_serialize(const ActivationDetails *p, FILE *f); -int activation_details_deserialize(const char *key, const char *value, ActivationDetails **info); -int activation_details_append_env(const ActivationDetails *info, char ***strv); -int activation_details_append_pair(const ActivationDetails *info, char ***strv); +void activation_details_serialize(const ActivationDetails *details, FILE *f); +int activation_details_deserialize(const char *key, const char *value, ActivationDetails **details); +int activation_details_append_env(const ActivationDetails *details, char ***strv); +int activation_details_append_pair(const ActivationDetails *details, char ***strv); DEFINE_TRIVIAL_CLEANUP_FUNC(ActivationDetails*, activation_details_unref); typedef struct ActivationDetailsVTable { @@ -175,24 +175,24 @@ typedef struct ActivationDetailsVTable { /* This should reset all type-specific variables. This should not allocate memory, and is called * with zero-initialized data. It should hence only initialize variables that need to be set != 0. */ - void (*init)(ActivationDetails *info, Unit *trigger_unit); + void (*init)(ActivationDetails *details, Unit *trigger_unit); /* This should free all type-specific variables. It should be idempotent. */ - void (*done)(ActivationDetails *info); + void (*done)(ActivationDetails *details); /* This should serialize all type-specific variables. */ - void (*serialize)(const ActivationDetails *info, FILE *f); + void (*serialize)(const ActivationDetails *details, FILE *f); /* This should deserialize all type-specific variables, one at a time. */ - int (*deserialize)(const char *key, const char *value, ActivationDetails **info); + int (*deserialize)(const char *key, const char *value, ActivationDetails **details); /* This should format the type-specific variables for the env block of the spawned service, * and return the number of added items. */ - int (*append_env)(const ActivationDetails *info, char ***strv); + int (*append_env)(const ActivationDetails *details, char ***strv); /* This should append type-specific variables as key/value pairs for the D-Bus property of the job, * and return the number of added pairs. */ - int (*append_pair)(const ActivationDetails *info, char ***strv); + int (*append_pair)(const ActivationDetails *details, char ***strv); } ActivationDetailsVTable; extern const ActivationDetailsVTable * const activation_details_vtable[_UNIT_TYPE_MAX]; @@ -819,7 +819,7 @@ Unit* unit_free(Unit *u); DEFINE_TRIVIAL_CLEANUP_FUNC(Unit *, unit_free); int unit_new_for_name(Manager *m, size_t size, const char *name, Unit **ret); -int unit_add_name(Unit *u, const char *name); +int unit_add_name(Unit *u, const char *text); int unit_add_dependency(Unit *u, UnitDependency d, Unit *other, bool add_reference, UnitDependencyMask mask); int unit_add_two_dependencies(Unit *u, UnitDependency d, UnitDependency e, Unit *other, bool add_reference, UnitDependencyMask mask); @@ -860,7 +860,7 @@ void unit_add_to_stop_notify_queue(Unit *u); void unit_remove_from_stop_notify_queue(Unit *u); int unit_merge(Unit *u, Unit *other); -int unit_merge_by_name(Unit *u, const char *other); +int unit_merge_by_name(Unit *u, const char *name); Unit *unit_follow_merge(Unit *u) _pure_; @@ -871,7 +871,7 @@ int unit_set_slice(Unit *u, Unit *slice); int unit_set_default_slice(Unit *u); const char* unit_description(Unit *u) _pure_; -const char* unit_status_string(Unit *u, char **combined); +const char* unit_status_string(Unit *u, char **ret_combined_buffer); bool unit_has_name(const Unit *u, const char *name); @@ -967,7 +967,7 @@ const char* unit_escape_setting(const char *s, UnitWriteFlags flags, char **buf) char* unit_concat_strv(char **l, UnitWriteFlags flags); int unit_write_setting(Unit *u, UnitWriteFlags flags, const char *name, const char *data); -int unit_write_settingf(Unit *u, UnitWriteFlags mode, const char *name, const char *format, ...) _printf_(4,5); +int unit_write_settingf(Unit *u, UnitWriteFlags flags, const char *name, const char *format, ...) _printf_(4,5); int unit_kill_context(Unit *u, KillOperation k); @@ -1003,7 +1003,7 @@ void unit_notify_user_lookup(Unit *u, uid_t uid, gid_t gid); int unit_set_invocation_id(Unit *u, sd_id128_t id); int unit_acquire_invocation_id(Unit *u); -int unit_set_exec_params(Unit *s, ExecParameters *p); +int unit_set_exec_params(Unit *u, ExecParameters *p); int unit_fork_helper_process(Unit *u, const char *name, bool into_cgroup, PidRef *ret); int unit_fork_and_watch_rm_rf(Unit *u, char **paths, PidRef *ret); diff --git a/src/coredump/coredump-config.h b/src/coredump/coredump-config.h index bb278f311e0..9e0152838c6 100644 --- a/src/coredump/coredump-config.h +++ b/src/coredump/coredump-config.h @@ -58,6 +58,6 @@ int coredump_parse_config(CoredumpConfig *config); uint64_t coredump_storage_size_max(const CoredumpConfig *config); /* Defined in generated coredump-gperf.c */ -const struct ConfigPerfItem* coredump_gperf_lookup(const char *key, GPERF_LEN_TYPE length); +const struct ConfigPerfItem* coredump_gperf_lookup(const char *str, GPERF_LEN_TYPE length); CONFIG_PARSER_PROTOTYPE(config_parse_coredump_storage); diff --git a/src/home/homed-conf.h b/src/home/homed-conf.h index 093dfeff76f..11e69c0dcbc 100644 --- a/src/home/homed-conf.h +++ b/src/home/homed-conf.h @@ -5,7 +5,7 @@ int manager_parse_config_file(Manager *m); -const struct ConfigPerfItem* homed_gperf_lookup(const char *key, GPERF_LEN_TYPE length); +const struct ConfigPerfItem* homed_gperf_lookup(const char *str, GPERF_LEN_TYPE length); CONFIG_PARSER_PROTOTYPE(config_parse_default_storage); CONFIG_PARSER_PROTOTYPE(config_parse_default_file_system_type); diff --git a/src/home/homed-home.h b/src/home/homed-home.h index 93f38d86d62..1f9a5488484 100644 --- a/src/home/homed-home.h +++ b/src/home/homed-home.h @@ -190,7 +190,7 @@ int home_authenticate(Home *h, UserRecord *secret, sd_bus_error *error); int home_deactivate(Home *h, bool force, sd_bus_error *error); int home_create(Home *h, UserRecord *secret, Hashmap *blobs, uint64_t flags, sd_bus_error *error); int home_remove(Home *h, sd_bus_error *error); -int home_update(Home *h, UserRecord *new_record, Hashmap *blobs, uint64_t flags, sd_bus_error *error); +int home_update(Home *h, UserRecord *hr, Hashmap *blobs, uint64_t flags, sd_bus_error *error); int home_resize(Home *h, uint64_t disk_size, UserRecord *secret, sd_bus_error *error); int home_passwd(Home *h, UserRecord *new_secret, UserRecord *old_secret, sd_bus_error *error); int home_unregister(Home *h, sd_bus_error *error); diff --git a/src/home/homework-mount.h b/src/home/homework-mount.h index 8f5244717d0..7fde0b5b689 100644 --- a/src/home/homework-mount.h +++ b/src/home/homework-mount.h @@ -6,5 +6,5 @@ int home_mount_node(const char *node, const char *fstype, bool discard, unsigned long flags, const char *extra_mount_options); int home_unshare_and_mkdir(void); int home_unshare_and_mount(const char *node, const char *fstype, bool discard, unsigned long flags, const char *extra_mount_options); -int home_move_mount(const char *user_name_and_realm, const char *target); +int home_move_mount(const char *mount_suffix, const char *target); int home_shift_uid(int dir_fd, const char *target, uid_t stored_uid, uid_t exposed_uid, int *ret_mount_fd); diff --git a/src/home/user-record-util.h b/src/home/user-record-util.h index 876baa4103f..e493e1dc3cd 100644 --- a/src/home/user-record-util.h +++ b/src/home/user-record-util.h @@ -9,7 +9,7 @@ #define HOMEWORK_BLOB_FDMAP_FIELD "__systemd_homework_internal_blob_fdmap" int user_record_synthesize(UserRecord *h, const char *user_name, const char *realm, const char *image_path, UserStorage storage, uid_t uid, gid_t gid); -int group_record_synthesize(GroupRecord *g, UserRecord *u); +int group_record_synthesize(GroupRecord *g, UserRecord *h); typedef enum UserReconcileMode { USER_RECONCILE_ANY, @@ -49,7 +49,7 @@ int user_record_test_recovery_key(UserRecord *h, UserRecord *secret); int user_record_update_last_changed(UserRecord *h, bool with_password); int user_record_set_disk_size(UserRecord *h, uint64_t disk_size); int user_record_set_password(UserRecord *h, char **password, bool prepend); -int user_record_make_hashed_password(UserRecord *h, char **password, bool extend); +int user_record_make_hashed_password(UserRecord *h, char **secret, bool extend); int user_record_set_token_pin(UserRecord *h, char **pin, bool prepend); int user_record_set_pkcs11_protected_authentication_path_permitted(UserRecord *h, int b); int user_record_set_fido2_user_presence_permitted(UserRecord *h, int b); diff --git a/src/import/pull-common.h b/src/import/pull-common.h index ffdabcb2495..e4c0d365309 100644 --- a/src/import/pull-common.h +++ b/src/import/pull-common.h @@ -9,14 +9,50 @@ typedef struct CurlGlue CurlGlue; typedef struct PullJob PullJob; -int pull_find_old_etags(const char *url, const char *root, int dt, const char *prefix, const char *suffix, char ***etags); +int pull_find_old_etags( + const char *url, + const char *root, + int dt, + const char *prefix, + const char *suffix, + char ***etags); -int pull_make_path(const char *url, const char *etag, const char *image_root, const char *prefix, const char *suffix, char **ret); +int pull_make_path( + const char *url, + const char *etag, + const char *image_root, + const char *prefix, + const char *suffix, + char **ret); -int pull_make_auxiliary_job(PullJob **ret, const char *url, int (*strip_suffixes)(const char *name, char **ret), const char *suffix, ImportVerify verify, CurlGlue *glue, PullJobOpenDisk on_open_disk, PullJobFinished on_finished, void *userdata); -int pull_make_verification_jobs(PullJob **ret_checksum_job, PullJob **ret_signature_job, ImportVerify verify, const char *url, CurlGlue *glue, PullJobFinished on_finished, void *userdata); +int pull_make_auxiliary_job( + PullJob **ret, + const char *url, + int (*strip_suffixes)(const char *name, char **ret), + const char *suffix, + ImportVerify verify, + CurlGlue *glue, + PullJobOpenDisk on_open_disk, + PullJobFinished on_finished, + void *userdata); +int pull_make_verification_jobs( + PullJob **ret_checksum_job, + PullJob **ret_signature_job, + ImportVerify verify, + const char *url, + CurlGlue *glue, + PullJobFinished on_finished, + void *userdata); -int pull_verify(ImportVerify verify, PullJob *main_job, PullJob *checksum_job, PullJob *signature_job, PullJob *settings_job, PullJob *roothash_job, PullJob *roothash_signature_job, PullJob *verity_job); +int pull_verify( + ImportVerify verify, + PullJob *main_job, + PullJob *checksum_job, + PullJob *signature_job, + PullJob *settings_job, + PullJob *roothash_job, + PullJob *roothash_signature_job, + PullJob *verity_job); typedef enum VerificationStyle { VERIFICATION_PER_FILE, /* SUSE-style ".sha256" files with detached gpg signature */ @@ -25,7 +61,7 @@ typedef enum VerificationStyle { _VERIFICATION_STYLE_INVALID = -EINVAL, } VerificationStyle; -int verification_style_from_url(const char *url, VerificationStyle *style); +int verification_style_from_url(const char *url, VerificationStyle *ret); typedef enum SignatureStyle { SIGNATURE_GPG_PER_FILE, /* ".sha256" files with detached .gpg signature */ @@ -36,7 +72,7 @@ typedef enum SignatureStyle { _SIGNATURE_STYLE_INVALID = -EINVAL, } SignatureStyle; -int signature_style_from_url(const char *url, SignatureStyle *style, char **ret_filename); +int signature_style_from_url(const char *url, SignatureStyle *ret, char **ret_filename); int pull_job_restart_with_sha256sum(PullJob *job, char **ret); int pull_job_restart_with_signature(PullJob *job, char **ret); diff --git a/src/journal-remote/journal-remote-main.c b/src/journal-remote/journal-remote-main.c index d7bac7a6bea..e8f23eefc1d 100644 --- a/src/journal-remote/journal-remote-main.c +++ b/src/journal-remote/journal-remote-main.c @@ -192,13 +192,8 @@ static int spawn_getter(const char *getter) { #if HAVE_MICROHTTPD -static int null_timer_event_handler(sd_event_source *s, - uint64_t usec, - void *userdata); -static int dispatch_http_event(sd_event_source *event, - int fd, - uint32_t revents, - void *userdata); +static int null_timer_event_handler(sd_event_source *timer_event, uint64_t usec, void *userdata); +static int dispatch_http_event(sd_event_source *event, int fd, uint32_t revents, void *userdata); static int build_accept_encoding(char **ret) { assert(ret); diff --git a/src/journal-remote/journal-remote-write.h b/src/journal-remote/journal-remote-write.h index 4c84bb2fac7..dd69a2ffcf5 100644 --- a/src/journal-remote/journal-remote-write.h +++ b/src/journal-remote/journal-remote-write.h @@ -25,7 +25,7 @@ Writer* writer_unref(Writer *w); DEFINE_TRIVIAL_CLEANUP_FUNC(Writer*, writer_unref); -int writer_write(Writer *s, +int writer_write(Writer *w, const struct iovec_wrapper *iovw, const dual_timestamp *ts, const sd_id128_t *boot_id, diff --git a/src/journal/journald-config.h b/src/journal/journald-config.h index 988badfb8a0..4aa78105e54 100644 --- a/src/journal/journald-config.h +++ b/src/journal/journald-config.h @@ -97,7 +97,7 @@ void manager_load_config(Manager *m); int manager_dispatch_reload_signal(sd_event_source *s, const struct signalfd_siginfo *si, void *userdata); /* Defined in generated journald-gperf.c */ -const struct ConfigPerfItem* journald_gperf_lookup(const char *key, GPERF_LEN_TYPE length); +const struct ConfigPerfItem* journald_gperf_lookup(const char *str, GPERF_LEN_TYPE length); const char* storage_to_string(Storage s) _const_; Storage storage_from_string(const char *s) _pure_; diff --git a/src/journal/journald-context.h b/src/journal/journald-context.h index ecc7185092d..e731b7c7257 100644 --- a/src/journal/journald-context.h +++ b/src/journal/journald-context.h @@ -81,7 +81,7 @@ void client_context_maybe_refresh( const struct ucred *ucred, const char *label, size_t label_size, const char *unit_id, - usec_t tstamp); + usec_t timestamp); void manager_refresh_client_contexts_on_reload(Manager *m, usec_t old_interval, unsigned old_burst); void client_context_acquire_default(Manager *m); diff --git a/src/journal/journald-manager.h b/src/journal/journald-manager.h index ff80f5b3eca..da1d2a6dfa6 100644 --- a/src/journal/journald-manager.h +++ b/src/journal/journald-manager.h @@ -167,7 +167,7 @@ typedef struct Manager { /* audit: Maximum number of extra fields we'll import from audit messages */ #define N_IOVEC_AUDIT_FIELDS 64 -void manager_dispatch_message(Manager *m, struct iovec *iovec, size_t n, size_t k, ClientContext *c, const struct timeval *tv, int priority, pid_t object_pid); +void manager_dispatch_message(Manager *m, struct iovec *iovec, size_t n, size_t mm, ClientContext *c, const struct timeval *tv, int priority, pid_t object_pid); void manager_driver_message_internal(Manager *m, pid_t object_pid, const char *format, ...) _sentinel_; #define manager_driver_message(...) manager_driver_message_internal(__VA_ARGS__, NULL) diff --git a/src/journal/journald-syslog.h b/src/journal/journald-syslog.h index bea49c1e81f..6c016dc2bd3 100644 --- a/src/journal/journald-syslog.h +++ b/src/journal/journald-syslog.h @@ -9,7 +9,7 @@ size_t syslog_parse_identifier(const char **buf, char **identifier, char **pid); void manager_forward_syslog(Manager *m, int priority, const char *identifier, const char *message, const struct ucred *ucred, const struct timeval *tv); -void manager_process_syslog_message(Manager *m, const char *buf, size_t buf_len, const struct ucred *ucred, const struct timeval *tv, const char *label, size_t label_len); +void manager_process_syslog_message(Manager *m, const char *buf, size_t raw_len, const struct ucred *ucred, const struct timeval *tv, const char *label, size_t label_len); int manager_open_syslog_socket(Manager *m, const char *syslog_socket); void manager_maybe_warn_forward_syslog_missed(Manager *m); diff --git a/src/libsystemd-network/dhcp-option.h b/src/libsystemd-network/dhcp-option.h index baaba1dcf2c..5ca1cafe388 100644 --- a/src/libsystemd-network/dhcp-option.h +++ b/src/libsystemd-network/dhcp-option.h @@ -31,7 +31,7 @@ int dhcp_option_append( size_t optlen, const void *optval); int dhcp_option_find_option(uint8_t *options, size_t length, uint8_t wanted_code, size_t *ret_offset); -int dhcp_option_remove_option(uint8_t *options, size_t buflen, uint8_t option_code); +int dhcp_option_remove_option(uint8_t *options, size_t length, uint8_t option_code); typedef int (*dhcp_option_callback_t)(uint8_t code, uint8_t len, const void *option, void *userdata); diff --git a/src/libsystemd-network/fuzz-dhcp-server-relay.c b/src/libsystemd-network/fuzz-dhcp-server-relay.c index 62c2d822f24..b2c881c0677 100644 --- a/src/libsystemd-network/fuzz-dhcp-server-relay.c +++ b/src/libsystemd-network/fuzz-dhcp-server-relay.c @@ -5,11 +5,11 @@ #include "fuzz.h" #include "sd-dhcp-server.c" -ssize_t sendto(int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen) { - return len; +ssize_t sendto(int __fd, const void *__buf, size_t __n, int flags, const struct sockaddr *__addr, socklen_t __addr_len) { + return __n; } -ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags) { +ssize_t sendmsg(int __fd, const struct msghdr *__message, int flags) { return 0; } diff --git a/src/libsystemd-network/fuzz-dhcp-server.c b/src/libsystemd-network/fuzz-dhcp-server.c index a91964fe0df..f20d993941f 100644 --- a/src/libsystemd-network/fuzz-dhcp-server.c +++ b/src/libsystemd-network/fuzz-dhcp-server.c @@ -9,11 +9,11 @@ #include "tmpfile-util.h" /* stub out network so that the server doesn't send */ -ssize_t sendto(int sockfd, const void *buf, size_t len, int flags, const struct sockaddr *dest_addr, socklen_t addrlen) { - return len; +ssize_t sendto(int __fd, const void *__buf, size_t __n, int flags, const struct sockaddr *__addr, socklen_t __addr_len) { + return __n; } -ssize_t sendmsg(int sockfd, const struct msghdr *msg, int flags) { +ssize_t sendmsg(int __fd, const struct msghdr *__message, int flags) { return 0; } diff --git a/src/libsystemd-network/icmp6-test-util.c b/src/libsystemd-network/icmp6-test-util.c index 761f6a0fb5f..38b3537ebe0 100644 --- a/src/libsystemd-network/icmp6-test-util.c +++ b/src/libsystemd-network/icmp6-test-util.c @@ -30,12 +30,12 @@ int icmp6_send(int fd, const struct in6_addr *dst, const struct iovec *iov, size int icmp6_receive( int fd, - void *iov_base, - size_t iov_len, + void *buffer, + size_t size, struct in6_addr *ret_sender, triple_timestamp *ret_timestamp) { - assert_se(read (fd, iov_base, iov_len) == (ssize_t) iov_len); + assert_se(read(fd, buffer, size) == (ssize_t) size); if (ret_timestamp) triple_timestamp_now(ret_timestamp); diff --git a/src/libsystemd-network/network-internal.h b/src/libsystemd-network/network-internal.h index 7e22723976e..658247e3501 100644 --- a/src/libsystemd-network/network-internal.h +++ b/src/libsystemd-network/network-internal.h @@ -8,11 +8,11 @@ size_t serialize_in_addrs(FILE *f, size_t size, bool *with_leading_space, bool (*predicate)(const struct in_addr *addr)); -int deserialize_in_addrs(struct in_addr **addresses, const char *string); +int deserialize_in_addrs(struct in_addr **ret, const char *string); void serialize_in6_addrs(FILE *f, const struct in6_addr *addresses, size_t size, bool *with_leading_space); -int deserialize_in6_addrs(struct in6_addr **addresses, const char *string); +int deserialize_in6_addrs(struct in6_addr **ret, const char *string); int serialize_dnr(FILE *f, const sd_dns_resolver *dnr, size_t n_dnr, bool *with_leading_space); int deserialize_dnr(sd_dns_resolver **ret, const char *string); diff --git a/src/libsystemd-network/sd-dhcp-lease.c b/src/libsystemd-network/sd-dhcp-lease.c index 1d200cb19f0..9f89f7bdafe 100644 --- a/src/libsystemd-network/sd-dhcp-lease.c +++ b/src/libsystemd-network/sd-dhcp-lease.c @@ -1799,14 +1799,14 @@ int dhcp_lease_set_client_id(sd_dhcp_lease *lease, const sd_dhcp_client_id *clie return 0; } -int sd_dhcp_lease_get_timezone(sd_dhcp_lease *lease, const char **tz) { +int sd_dhcp_lease_get_timezone(sd_dhcp_lease *lease, const char **ret) { assert_return(lease, -EINVAL); - assert_return(tz, -EINVAL); + assert_return(ret, -EINVAL); if (!lease->timezone) return -ENODATA; - *tz = lease->timezone; + *ret = lease->timezone; return 0; } diff --git a/src/libsystemd/sd-bus/bus-convenience.c b/src/libsystemd/sd-bus/bus-convenience.c index a6fcc34d347..4807fb2b7f2 100644 --- a/src/libsystemd/sd-bus/bus-convenience.c +++ b/src/libsystemd/sd-bus/bus-convenience.c @@ -10,12 +10,12 @@ #include "bus-type.h" #include "string-util.h" -_public_ int sd_bus_message_send(sd_bus_message *reply) { - assert_return(reply, -EINVAL); - assert_return(reply->bus, -EINVAL); - assert_return(!bus_origin_changed(reply->bus), -ECHILD); +_public_ int sd_bus_message_send(sd_bus_message *m) { + assert_return(m, -EINVAL); + assert_return(m->bus, -EINVAL); + assert_return(!bus_origin_changed(m->bus), -ECHILD); - return sd_bus_send(reply->bus, reply, NULL); + return sd_bus_send(m->bus, m, NULL); } _public_ int sd_bus_emit_signal_tov( @@ -325,7 +325,7 @@ _public_ int sd_bus_reply_method_errorf( _public_ int sd_bus_reply_method_errno( sd_bus_message *call, int error, - const sd_bus_error *p) { + const sd_bus_error *e) { _cleanup_(sd_bus_error_free) sd_bus_error berror = SD_BUS_ERROR_NULL; @@ -341,8 +341,8 @@ _public_ int sd_bus_reply_method_errno( if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) return 0; - if (sd_bus_error_is_set(p)) - return sd_bus_reply_method_error(call, p); + if (sd_bus_error_is_set(e)) + return sd_bus_reply_method_error(call, e); sd_bus_error_set_errno(&berror, error); @@ -640,20 +640,20 @@ _public_ int sd_bus_set_property( return r; } -_public_ int sd_bus_query_sender_creds(sd_bus_message *call, uint64_t mask, sd_bus_creds **ret) { +_public_ int sd_bus_query_sender_creds(sd_bus_message *m, uint64_t mask, sd_bus_creds **ret) { uint64_t missing; sd_bus_creds *c; - assert_return(call, -EINVAL); - assert_return(call->sealed, -EPERM); - assert_return(call->bus, -EINVAL); - assert_return(!bus_origin_changed(call->bus), -ECHILD); + assert_return(m, -EINVAL); + assert_return(m->sealed, -EPERM); + assert_return(m->bus, -EINVAL); + assert_return(!bus_origin_changed(m->bus), -ECHILD); assert_return(ret, -EINVAL); - if (!BUS_IS_OPEN(call->bus->state)) + if (!BUS_IS_OPEN(m->bus->state)) return -ENOTCONN; - c = sd_bus_message_get_creds(call); + c = sd_bus_message_get_creds(m); if (c) missing = mask & ~SD_BUS_CREDS_AUGMENT & ~c->mask; else @@ -664,31 +664,31 @@ _public_ int sd_bus_query_sender_creds(sd_bus_message *call, uint64_t mask, sd_b } /* There's a sender, use that */ - if (call->sender && call->bus->bus_client) - return sd_bus_get_name_creds(call->bus, call->sender, mask, ret); + if (m->sender && m->bus->bus_client) + return sd_bus_get_name_creds(m->bus, m->sender, mask, ret); /* There's no sender. For direct connections the credentials of the AF_UNIX peer matter, which may be * queried via sd_bus_get_owner_creds(). */ - return sd_bus_get_owner_creds(call->bus, mask, ret); + return sd_bus_get_owner_creds(m->bus, mask, ret); } -_public_ int sd_bus_query_sender_privilege(sd_bus_message *call, int capability) { +_public_ int sd_bus_query_sender_privilege(sd_bus_message *m, int capability) { _cleanup_(sd_bus_creds_unrefp) sd_bus_creds *creds = NULL; uid_t our_uid; bool know_caps = false; int r; - assert_return(call, -EINVAL); - assert_return(call->sealed, -EPERM); - assert_return(call->bus, -EINVAL); - assert_return(!bus_origin_changed(call->bus), -ECHILD); + assert_return(m, -EINVAL); + assert_return(m->sealed, -EPERM); + assert_return(m->bus, -EINVAL); + assert_return(!bus_origin_changed(m->bus), -ECHILD); - if (!BUS_IS_OPEN(call->bus->state)) + if (!BUS_IS_OPEN(m->bus->state)) return -ENOTCONN; if (capability >= 0) { - r = sd_bus_query_sender_creds(call, SD_BUS_CREDS_UID|SD_BUS_CREDS_EUID|SD_BUS_CREDS_EFFECTIVE_CAPS, &creds); + r = sd_bus_query_sender_creds(m, SD_BUS_CREDS_UID|SD_BUS_CREDS_EUID|SD_BUS_CREDS_EFFECTIVE_CAPS, &creds); if (r < 0) return r; @@ -705,7 +705,7 @@ _public_ int sd_bus_query_sender_privilege(sd_bus_message *call, int capability) if (r == 0) know_caps = true; } else { - r = sd_bus_query_sender_creds(call, SD_BUS_CREDS_UID|SD_BUS_CREDS_EUID, &creds); + r = sd_bus_query_sender_creds(m, SD_BUS_CREDS_UID|SD_BUS_CREDS_EUID, &creds); if (r < 0) return r; } diff --git a/src/libsystemd/sd-bus/bus-dump.h b/src/libsystemd/sd-bus/bus-dump.h index ecf7598c854..6dee318df9d 100644 --- a/src/libsystemd/sd-bus/bus-dump.h +++ b/src/libsystemd/sd-bus/bus-dump.h @@ -5,5 +5,5 @@ int bus_creds_dump(sd_bus_creds *c, FILE *f, bool terse); -int bus_pcap_header(size_t snaplen, const char *os, const char *app, FILE *f); +int bus_pcap_header(size_t snaplen, const char *os, const char *info, FILE *f); int bus_message_pcap_frame(sd_bus_message *m, size_t snaplen, FILE *f); diff --git a/src/libsystemd/sd-bus/bus-match.h b/src/libsystemd/sd-bus/bus-match.h index 7dcca27f565..676304af034 100644 --- a/src/libsystemd/sd-bus/bus-match.h +++ b/src/libsystemd/sd-bus/bus-match.h @@ -77,7 +77,7 @@ typedef enum BusMatchScope { BUS_MATCH_DRIVER, } BusMatchScope; -int bus_match_run(sd_bus *bus, BusMatchNode *root, sd_bus_message *m); +int bus_match_run(sd_bus *bus, BusMatchNode *node, sd_bus_message *m); int bus_match_add(BusMatchNode *root, BusMatchComponent *components, size_t n_components, BusMatchCallback *callback); int bus_match_remove(BusMatchNode *root, BusMatchCallback *callback); diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c index 601e0152de6..89ac7af341a 100644 --- a/src/libsystemd/sd-bus/bus-message.c +++ b/src/libsystemd/sd-bus/bus-message.c @@ -700,12 +700,12 @@ _public_ int sd_bus_message_new_method_errno( sd_bus_message *call, sd_bus_message **ret, int error, - const sd_bus_error *p) { + const sd_bus_error *e) { _cleanup_(sd_bus_error_free) sd_bus_error berror = SD_BUS_ERROR_NULL; - if (sd_bus_error_is_set(p)) - return sd_bus_message_new_method_error(call, ret, p); + if (sd_bus_error_is_set(e)) + return sd_bus_message_new_method_error(call, ret, e); sd_bus_error_set_errno(&berror, error); diff --git a/src/libsystemd/sd-bus/bus-message.h b/src/libsystemd/sd-bus/bus-message.h index d4c80022795..90939b750b3 100644 --- a/src/libsystemd/sd-bus/bus-message.h +++ b/src/libsystemd/sd-bus/bus-message.h @@ -189,7 +189,7 @@ int bus_message_get_arg_strv(sd_bus_message *m, unsigned i, char ***strv); int bus_body_part_map(BusMessageBodyPart *part); void bus_body_part_unmap(BusMessageBodyPart *part); -int bus_message_new_synthetic_error(sd_bus *bus, uint64_t serial, const sd_bus_error *e, sd_bus_message **m); +int bus_message_new_synthetic_error(sd_bus *bus, uint64_t cookie, const sd_bus_error *e, sd_bus_message **m); int bus_message_remarshal(sd_bus *bus, sd_bus_message **m); diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c index 050cfac55ea..eecde50d741 100644 --- a/src/libsystemd/sd-bus/sd-bus.c +++ b/src/libsystemd/sd-bus/sd-bus.c @@ -3972,18 +3972,18 @@ _public_ int sd_bus_default(sd_bus **ret) { return bus_default(bus_open, busp, ret); } -_public_ int sd_bus_get_tid(sd_bus *b, pid_t *tid) { +_public_ int sd_bus_get_tid(sd_bus *b, pid_t *ret) { assert_return(b, -EINVAL); - assert_return(tid, -EINVAL); + assert_return(ret, -EINVAL); assert_return(!bus_origin_changed(b), -ECHILD); if (b->tid != 0) { - *tid = b->tid; + *ret = b->tid; return 0; } if (b->event) - return sd_event_get_tid(b->event, tid); + return sd_event_get_tid(b->event, ret); return -ENXIO; } diff --git a/src/libsystemd/sd-device/device-internal.h b/src/libsystemd/sd-device/device-internal.h index e85ac9e05e3..16a57923502 100644 --- a/src/libsystemd/sd-device/device-internal.h +++ b/src/libsystemd/sd-device/device-internal.h @@ -109,7 +109,7 @@ static inline int device_add_property_internal(sd_device *device, const char *ke } int device_set_syspath(sd_device *device, const char *_syspath, bool verify); -int device_set_ifindex(sd_device *device, const char *ifindex); +int device_set_ifindex(sd_device *device, const char *name); int device_set_devuid(sd_device *device, const char *uid); int device_set_devgid(sd_device *device, const char *gid); int device_set_devmode(sd_device *device, const char *devmode); diff --git a/src/libsystemd/sd-device/device-private.h b/src/libsystemd/sd-device/device-private.h index 9068b5497fd..2bdc0492c6b 100644 --- a/src/libsystemd/sd-device/device-private.h +++ b/src/libsystemd/sd-device/device-private.h @@ -41,7 +41,7 @@ int device_ensure_usec_initialized(sd_device *device, sd_device *device_old); int device_add_devlink(sd_device *device, const char *devlink); int device_remove_devlink(sd_device *device, const char *devlink); bool device_has_devlink(sd_device *device, const char *devlink); -int device_add_property(sd_device *device, const char *property, const char *value); +int device_add_property(sd_device *device, const char *key, const char *value); int device_add_propertyf(sd_device *device, const char *key, const char *format, ...) _printf_(3, 4); int device_add_tag(sd_device *device, const char *tag, bool both); void device_remove_tag(sd_device *device, const char *tag); diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c index 0b77126b2c4..94d4a8647ec 100644 --- a/src/libsystemd/sd-device/sd-device.c +++ b/src/libsystemd/sd-device/sd-device.c @@ -1139,24 +1139,24 @@ static int device_new_from_child(sd_device **ret, sd_device *child) { } } -_public_ int sd_device_get_parent(sd_device *child, sd_device **ret) { +_public_ int sd_device_get_parent(sd_device *device, sd_device **ret) { int r; - assert_return(child, -EINVAL); + assert_return(device, -EINVAL); - if (!child->parent_set) { - r = device_new_from_child(&child->parent, child); + if (!device->parent_set) { + r = device_new_from_child(&device->parent, device); if (r < 0 && r != -ENODEV) return r; - child->parent_set = true; + device->parent_set = true; } - if (!child->parent) + if (!device->parent) return -ENOENT; if (ret) - *ret = child->parent; + *ret = device->parent; return 0; } @@ -1276,7 +1276,7 @@ _public_ int sd_device_get_driver_subsystem(sd_device *device, const char **ret) return 0; } -_public_ int sd_device_get_devtype(sd_device *device, const char **devtype) { +_public_ int sd_device_get_devtype(sd_device *device, const char **ret) { int r; assert_return(device, -EINVAL); @@ -1288,8 +1288,8 @@ _public_ int sd_device_get_devtype(sd_device *device, const char **devtype) { if (!device->devtype) return -ENOENT; - if (devtype) - *devtype = device->devtype; + if (ret) + *ret = device->devtype; return 0; } @@ -1398,7 +1398,7 @@ _public_ int sd_device_get_devpath(sd_device *device, const char **ret) { return 0; } -_public_ int sd_device_get_devname(sd_device *device, const char **devname) { +_public_ int sd_device_get_devname(sd_device *device, const char **ret) { int r; assert_return(device, -EINVAL); @@ -1412,8 +1412,8 @@ _public_ int sd_device_get_devname(sd_device *device, const char **devname) { assert(!isempty(path_startswith(device->devname, "/dev/"))); - if (devname) - *devname = device->devname; + if (ret) + *ret = device->devname; return 0; } diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c index de855159345..a2a70c99406 100644 --- a/src/libsystemd/sd-event/sd-event.c +++ b/src/libsystemd/sd-event/sd-event.c @@ -3026,13 +3026,13 @@ static int event_source_online( return 1; } -_public_ int sd_event_source_set_enabled(sd_event_source *s, int m) { +_public_ int sd_event_source_set_enabled(sd_event_source *s, int enabled) { int r; - assert_return(IN_SET(m, SD_EVENT_OFF, SD_EVENT_ON, SD_EVENT_ONESHOT), -EINVAL); + assert_return(IN_SET(enabled, SD_EVENT_OFF, SD_EVENT_ON, SD_EVENT_ONESHOT), -EINVAL); /* Quick mode: if the source doesn't exist, SD_EVENT_OFF is a noop. */ - if (m == SD_EVENT_OFF && !s) + if (enabled == SD_EVENT_OFF && !s) return 0; assert_return(s, -EINVAL); @@ -3040,15 +3040,15 @@ _public_ int sd_event_source_set_enabled(sd_event_source *s, int m) { /* If we are dead anyway, we are fine with turning off sources, but everything else needs to fail. */ if (s->event->state == SD_EVENT_FINISHED) - return m == SD_EVENT_OFF ? 0 : -ESTALE; + return enabled == SD_EVENT_OFF ? 0 : -ESTALE; - if (s->enabled == m) /* No change? */ + if (s->enabled == enabled) /* No change? */ return 0; - if (m == SD_EVENT_OFF) - r = event_source_offline(s, m, s->ratelimited); + if (enabled == SD_EVENT_OFF) + r = event_source_offline(s, enabled, s->ratelimited); else - r = event_source_online(s, m, s->ratelimited); + r = event_source_online(s, enabled, s->ratelimited); if (r < 0) return r; diff --git a/src/libsystemd/sd-journal/journal-authenticate.h b/src/libsystemd/sd-journal/journal-authenticate.h index 3fa9caeaeb5..89897fc0a7a 100644 --- a/src/libsystemd/sd-journal/journal-authenticate.h +++ b/src/libsystemd/sd-journal/journal-authenticate.h @@ -17,6 +17,6 @@ int journal_file_fss_load(JournalFile *f); int journal_file_parse_verification_key(JournalFile *f, const char *key); int journal_file_fsprg_evolve(JournalFile *f, uint64_t realtime); -int journal_file_fsprg_seek(JournalFile *f, uint64_t epoch); +int journal_file_fsprg_seek(JournalFile *f, uint64_t goal); bool journal_file_next_evolve_usec(JournalFile *f, usec_t *u); diff --git a/src/libsystemd/sd-journal/journal-file.h b/src/libsystemd/sd-journal/journal-file.h index 472f91f546b..1e5993b0a6d 100644 --- a/src/libsystemd/sd-journal/journal-file.h +++ b/src/libsystemd/sd-journal/journal-file.h @@ -150,7 +150,7 @@ int journal_file_open( JournalFile **ret); int journal_file_set_offline_thread_join(JournalFile *f); -JournalFile* journal_file_close(JournalFile *j); +JournalFile* journal_file_close(JournalFile *f); int journal_file_fstat(JournalFile *f); DEFINE_TRIVIAL_CLEANUP_FUNC(JournalFile*, journal_file_close); diff --git a/src/libsystemd/sd-journal/sd-journal.c b/src/libsystemd/sd-journal/sd-journal.c index 696f336945b..a02c358fad8 100644 --- a/src/libsystemd/sd-journal/sd-journal.c +++ b/src/libsystemd/sd-journal/sd-journal.c @@ -2324,14 +2324,14 @@ static sd_journal *journal_new(int flags, const char *path, const char *namespac SD_JOURNAL_INCLUDE_DEFAULT_NAMESPACE | \ SD_JOURNAL_ASSUME_IMMUTABLE) -_public_ int sd_journal_open_namespace(sd_journal **ret, const char *namespace, int flags) { +_public_ int sd_journal_open_namespace(sd_journal **ret, const char *name_space, int flags) { _cleanup_(sd_journal_closep) sd_journal *j = NULL; int r; assert_return(ret, -EINVAL); assert_return((flags & ~OPEN_ALLOWED_FLAGS) == 0, -EINVAL); - j = journal_new(flags, NULL, namespace); + j = journal_new(flags, NULL, name_space); if (!j) return -ENOMEM; @@ -2813,7 +2813,7 @@ static bool field_is_valid(const char *field) { return true; } -_public_ int sd_journal_get_data(sd_journal *j, const char *field, const void **data, size_t *size) { +_public_ int sd_journal_get_data(sd_journal *j, const char *field, const void **data, size_t *length) { JournalFile *f; size_t field_length; Object *o; @@ -2823,7 +2823,7 @@ _public_ int sd_journal_get_data(sd_journal *j, const char *field, const void ** assert_return(!journal_origin_changed(j), -ECHILD); assert_return(field, -EINVAL); assert_return(data, -EINVAL); - assert_return(size, -EINVAL); + assert_return(length, -EINVAL); assert_return(field_is_valid(field), -EINVAL); f = j->current_file; @@ -2857,7 +2857,7 @@ _public_ int sd_journal_get_data(sd_journal *j, const char *field, const void ** return r; *data = d; - *size = l; + *length = l; return 0; } @@ -2865,7 +2865,7 @@ _public_ int sd_journal_get_data(sd_journal *j, const char *field, const void ** return -ENOENT; } -_public_ int sd_journal_enumerate_data(sd_journal *j, const void **data, size_t *size) { +_public_ int sd_journal_enumerate_data(sd_journal *j, const void **data, size_t *length) { JournalFile *f; Object *o; int r; @@ -2873,7 +2873,7 @@ _public_ int sd_journal_enumerate_data(sd_journal *j, const void **data, size_t assert_return(j, -EINVAL); assert_return(!journal_origin_changed(j), -ECHILD); assert_return(data, -EINVAL); - assert_return(size, -EINVAL); + assert_return(length, -EINVAL); f = j->current_file; if (!f) @@ -2902,7 +2902,7 @@ _public_ int sd_journal_enumerate_data(sd_journal *j, const void **data, size_t assert(r > 0); *data = d; - *size = l; + *length = l; j->current_field++; @@ -2912,11 +2912,11 @@ _public_ int sd_journal_enumerate_data(sd_journal *j, const void **data, size_t return 0; } -_public_ int sd_journal_enumerate_available_data(sd_journal *j, const void **data, size_t *size) { +_public_ int sd_journal_enumerate_available_data(sd_journal *j, const void **data, size_t *length) { for (;;) { int r; - r = sd_journal_enumerate_data(j, data, size); + r = sd_journal_enumerate_data(j, data, length); if (r >= 0) return r; if (!JOURNAL_ERRNO_IS_UNAVAILABLE_FIELD(r)) @@ -3300,13 +3300,13 @@ void journal_print_header(sd_journal *j) { } } -_public_ int sd_journal_get_usage(sd_journal *j, uint64_t *ret) { +_public_ int sd_journal_get_usage(sd_journal *j, uint64_t *ret_bytes) { JournalFile *f; uint64_t sum = 0; assert_return(j, -EINVAL); assert_return(!journal_origin_changed(j), -ECHILD); - assert_return(ret, -EINVAL); + assert_return(ret_bytes, -EINVAL); ORDERED_HASHMAP_FOREACH(f, j->files) { struct stat st; @@ -3325,7 +3325,7 @@ _public_ int sd_journal_get_usage(sd_journal *j, uint64_t *ret) { sum += b; } - *ret = sum; + *ret_bytes = sum; return 0; } diff --git a/src/libsystemd/sd-json/sd-json.c b/src/libsystemd/sd-json/sd-json.c index 295f30ff15a..c18807444de 100644 --- a/src/libsystemd/sd-json/sd-json.c +++ b/src/libsystemd/sd-json/sd-json.c @@ -1277,7 +1277,7 @@ mismatch: return 0; } -_public_ sd_json_variant *sd_json_variant_by_index(sd_json_variant *v, size_t idx) { +_public_ sd_json_variant *sd_json_variant_by_index(sd_json_variant *v, size_t index) { if (!v) return NULL; if (v == JSON_VARIANT_MAGIC_EMPTY_ARRAY || @@ -1288,11 +1288,11 @@ _public_ sd_json_variant *sd_json_variant_by_index(sd_json_variant *v, size_t id if (!IN_SET(v->type, SD_JSON_VARIANT_ARRAY, SD_JSON_VARIANT_OBJECT)) goto mismatch; if (v->is_reference) - return sd_json_variant_by_index(v->reference, idx); - if (idx >= v->n_elements) + return sd_json_variant_by_index(v->reference, index); + if (index >= v->n_elements) return NULL; - return json_variant_conservative_formalize(v + 1 + idx); + return json_variant_conservative_formalize(v + 1 + index); mismatch: log_debug("Element in non-array/non-object JSON variant requested by index, returning NULL."); @@ -2079,22 +2079,22 @@ _public_ int sd_json_variant_set_field_uuid(sd_json_variant **v, const char *fie return sd_json_variant_set_field_string(v, field, SD_ID128_TO_UUID_STRING(value)); } -_public_ int sd_json_variant_set_field_integer(sd_json_variant **v, const char *field, int64_t i) { +_public_ int sd_json_variant_set_field_integer(sd_json_variant **v, const char *field, int64_t value) { _cleanup_(sd_json_variant_unrefp) sd_json_variant *m = NULL; int r; - r = sd_json_variant_new_integer(&m, i); + r = sd_json_variant_new_integer(&m, value); if (r < 0) return r; return sd_json_variant_set_field(v, field, m); } -_public_ int sd_json_variant_set_field_unsigned(sd_json_variant **v, const char *field, uint64_t u) { +_public_ int sd_json_variant_set_field_unsigned(sd_json_variant **v, const char *field, uint64_t value) { _cleanup_(sd_json_variant_unrefp) sd_json_variant *m = NULL; int r; - r = sd_json_variant_new_unsigned(&m, u); + r = sd_json_variant_new_unsigned(&m, value); if (r < 0) return r; @@ -3379,7 +3379,7 @@ finish: } _public_ int sd_json_parse_with_source( - const char *input, + const char *string, const char *source, sd_json_parse_flags_t flags, sd_json_variant **ret, @@ -3388,7 +3388,7 @@ _public_ int sd_json_parse_with_source( _cleanup_(json_source_unrefp) JsonSource *s = NULL; - if (isempty(input)) + if (isempty(string)) return -ENODATA; if (source) { @@ -3397,7 +3397,7 @@ _public_ int sd_json_parse_with_source( return -ENOMEM; } - return json_parse_internal(&input, s, flags, ret, reterr_line, reterr_column, false); + return json_parse_internal(&string, s, flags, ret, reterr_line, reterr_column, false); } _public_ int sd_json_parse_with_source_continue( diff --git a/src/libsystemd/sd-login/sd-login.c b/src/libsystemd/sd-login/sd-login.c index b559b4576b2..f65fb2077e1 100644 --- a/src/libsystemd/sd-login/sd-login.c +++ b/src/libsystemd/sd-login/sd-login.c @@ -63,12 +63,12 @@ _public_ int sd_pid_get_user_unit(pid_t pid, char **ret_unit) { return IN_SET(r, -ENXIO, -ENOMEDIUM) ? -ENODATA : r; } -_public_ int sd_pid_get_machine_name(pid_t pid, char **ret_name) { +_public_ int sd_pid_get_machine_name(pid_t pid, char **ret_machine) { int r; assert_return(pid >= 0, -EINVAL); - r = cg_pid_get_machine_name(pid, ret_name); + r = cg_pid_get_machine_name(pid, ret_machine); return IN_SET(r, -ENXIO, -ENOMEDIUM) ? -ENODATA : r; } @@ -196,7 +196,7 @@ _public_ int sd_pidfd_get_user_unit(int pidfd, char **ret_unit) { return 0; } -_public_ int sd_pidfd_get_machine_name(int pidfd, char **ret_name) { +_public_ int sd_pidfd_get_machine_name(int pidfd, char **ret_machine) { _cleanup_free_ char *name = NULL; pid_t pid; int r; @@ -215,8 +215,8 @@ _public_ int sd_pidfd_get_machine_name(int pidfd, char **ret_name) { if (r < 0) return r; - if (ret_name) - *ret_name = TAKE_PTR(name); + if (ret_machine) + *ret_machine = TAKE_PTR(name); return 0; } @@ -469,7 +469,7 @@ _public_ int sd_uid_get_state(uid_t uid, char **ret_state) { return 0; } -_public_ int sd_uid_get_display(uid_t uid, char **ret_session) { +_public_ int sd_uid_get_display(uid_t uid, char **ret_display) { _cleanup_free_ char *p = NULL, *s = NULL; int r; @@ -485,8 +485,8 @@ _public_ int sd_uid_get_display(uid_t uid, char **ret_session) { if (isempty(s)) return -ENODATA; - if (ret_session) - *ret_session = TAKE_PTR(s); + if (ret_display) + *ret_display = TAKE_PTR(s); return 0; } @@ -790,8 +790,8 @@ _public_ int sd_session_get_type(const char *session, char **ret_type) { return session_get_string(session, "TYPE", ret_type); } -_public_ int sd_session_get_class(const char *session, char **ret_class) { - return session_get_string(session, "CLASS", ret_class); +_public_ int sd_session_get_class(const char *session, char **ret_clazz) { + return session_get_string(session, "CLASS", ret_clazz); } _public_ int sd_session_get_desktop(const char *session, char **ret_desktop) { @@ -1059,7 +1059,7 @@ _public_ int sd_get_machine_names(char ***ret_machines) { return r; } -_public_ int sd_machine_get_class(const char *machine, char **ret_class) { +_public_ int sd_machine_get_class(const char *machine, char **ret_clazz) { _cleanup_free_ char *c = NULL; int r; @@ -1084,8 +1084,8 @@ _public_ int sd_machine_get_class(const char *machine, char **ret_class) { return -EIO; } - if (ret_class) - *ret_class = TAKE_PTR(c); + if (ret_clazz) + *ret_clazz = TAKE_PTR(c); return 0; } diff --git a/src/libsystemd/sd-netlink/netlink-internal.h b/src/libsystemd/sd-netlink/netlink-internal.h index 888637c3721..1b8f4afcb09 100644 --- a/src/libsystemd/sd-netlink/netlink-internal.h +++ b/src/libsystemd/sd-netlink/netlink-internal.h @@ -175,7 +175,7 @@ int sd_nfnl_socket_open(sd_netlink **ret); int sd_nfnl_send_batch( sd_netlink *nfnl, sd_netlink_message **messages, - size_t msgcount, + size_t n_messages, uint32_t **ret_serials); int sd_nfnl_call_batch( sd_netlink *nfnl, @@ -199,7 +199,7 @@ int sd_nfnl_nft_message_new_rule(sd_netlink *nfnl, sd_netlink_message **ret, int nfproto, const char *table, const char *chain); int sd_nfnl_nft_message_new_set(sd_netlink *nfnl, sd_netlink_message **ret, int nfproto, const char *table, const char *set_name, - uint32_t setid, uint32_t klen); + uint32_t set_id, uint32_t klen); int sd_nfnl_nft_message_new_setelems(sd_netlink *nfnl, sd_netlink_message **ret, int add, int nfproto, const char *table, const char *set_name); int sd_nfnl_nft_message_append_setelem(sd_netlink_message *m, diff --git a/src/libsystemd/sd-netlink/netlink-message-rtnl.c b/src/libsystemd/sd-netlink/netlink-message-rtnl.c index ee6bba8d03a..4883614297b 100644 --- a/src/libsystemd/sd-netlink/netlink-message-rtnl.c +++ b/src/libsystemd/sd-netlink/netlink-message-rtnl.c @@ -54,7 +54,8 @@ static bool rtnl_message_type_is_nsid(uint16_t type) { return IN_SET(type, RTM_NEWNSID, RTM_DELNSID, RTM_GETNSID); } -#define DEFINE_RTNL_MESSAGE_SETTER(class, header_type, element, name, value_type) \ +#define DEFINE_RTNL_MESSAGE_SETTER(class, header_type, element, name, value_type) \ + /* NOLINTNEXTLINE (readability-inconsistent-declaration-parameter-name) */ \ int sd_rtnl_message_##class##_set_##name(sd_netlink_message *m, value_type value) { \ assert_return(m, -EINVAL); \ assert_return(m->hdr, -EINVAL); \ @@ -66,6 +67,7 @@ static bool rtnl_message_type_is_nsid(uint16_t type) { } #define DEFINE_RTNL_MESSAGE_PREFIXLEN_SETTER(class, header_type, family_element, element, name, value_type) \ + /* NOLINTNEXTLINE (readability-inconsistent-declaration-parameter-name) */ \ int sd_rtnl_message_##class##_set_##name(sd_netlink_message *m, value_type value) { \ assert_return(m, -EINVAL); \ assert_return(m->hdr, -EINVAL); \ diff --git a/src/libsystemd/sd-netlink/netlink-types.h b/src/libsystemd/sd-netlink/netlink-types.h index c11e5d9ec00..3c1bfdc2800 100644 --- a/src/libsystemd/sd-netlink/netlink-types.h +++ b/src/libsystemd/sd-netlink/netlink-types.h @@ -56,8 +56,8 @@ int netlink_get_policy_set_and_header_size( size_t *ret_header_size); const NLAPolicy *policy_set_get_policy(const NLAPolicySet *policy_set, uint16_t attr_type); -const NLAPolicySet *policy_set_get_policy_set(const NLAPolicySet *type_system, uint16_t attr_type); -const NLAPolicySetUnion *policy_set_get_policy_set_union(const NLAPolicySet *type_system, uint16_t attr_type); +const NLAPolicySet *policy_set_get_policy_set(const NLAPolicySet *policy_set, uint16_t attr_type); +const NLAPolicySetUnion *policy_set_get_policy_set_union(const NLAPolicySet *policy_set, uint16_t attr_type); uint16_t policy_set_union_get_match_attribute(const NLAPolicySetUnion *policy_set_union); -const NLAPolicySet *policy_set_union_get_policy_set_by_string(const NLAPolicySetUnion *type_system_union, const char *string); -const NLAPolicySet *policy_set_union_get_policy_set_by_family(const NLAPolicySetUnion *type_system_union, int family); +const NLAPolicySet *policy_set_union_get_policy_set_by_string(const NLAPolicySetUnion *policy_set_union, const char *string); +const NLAPolicySet *policy_set_union_get_policy_set_by_family(const NLAPolicySetUnion *policy_set_union, int family); diff --git a/src/libsystemd/sd-netlink/netlink-util.h b/src/libsystemd/sd-netlink/netlink-util.h index b84018f1bce..02b17f50cf8 100644 --- a/src/libsystemd/sd-netlink/netlink-util.h +++ b/src/libsystemd/sd-netlink/netlink-util.h @@ -157,8 +157,8 @@ int netlink_message_append_hw_addr(sd_netlink_message *m, unsigned short type, c int netlink_message_append_in_addr_union(sd_netlink_message *m, unsigned short type, int family, const union in_addr_union *data); int netlink_message_append_sockaddr_union(sd_netlink_message *m, unsigned short type, const union sockaddr_union *data); -int netlink_message_read_hw_addr(sd_netlink_message *m, unsigned short type, struct hw_addr_data *data); -int netlink_message_read_in_addr_union(sd_netlink_message *m, unsigned short type, int family, union in_addr_union *data); +int netlink_message_read_hw_addr(sd_netlink_message *m, unsigned short type, struct hw_addr_data *ret); +int netlink_message_read_in_addr_union(sd_netlink_message *m, unsigned short type, int family, union in_addr_union *ret); void rtattr_append_attribute_internal(struct rtattr *rta, unsigned short type, const void *data, size_t data_length); int rtattr_append_attribute(struct rtattr **rta, unsigned short type, const void *data, size_t data_length); @@ -168,4 +168,4 @@ void netlink_seal_message(sd_netlink *nl, sd_netlink_message *m); size_t netlink_get_reply_callback_count(sd_netlink *nl); /* TODO: to be exported later */ -int sd_netlink_sendv(sd_netlink *nl, sd_netlink_message **messages, size_t msgcnt, uint32_t **ret_serial); +int sd_netlink_sendv(sd_netlink *nl, sd_netlink_message **messages, size_t msgcount, uint32_t **ret_serial); diff --git a/src/libsystemd/sd-netlink/sd-netlink.c b/src/libsystemd/sd-netlink/sd-netlink.c index fe0c1a0080a..cd66b2e8322 100644 --- a/src/libsystemd/sd-netlink/sd-netlink.c +++ b/src/libsystemd/sd-netlink/sd-netlink.c @@ -540,16 +540,16 @@ int sd_netlink_call_async( int sd_netlink_read( sd_netlink *nl, uint32_t serial, - uint64_t usec, + uint64_t timeout, sd_netlink_message **ret) { - usec_t timeout; + usec_t usec; int r; assert_return(nl, -EINVAL); assert_return(!netlink_pid_changed(nl), -ECHILD); - timeout = timespan_to_timestamp(usec); + usec = timespan_to_timestamp(timeout); for (;;) { _cleanup_(sd_netlink_message_unrefp) sd_netlink_message *m = NULL; @@ -588,14 +588,14 @@ int sd_netlink_read( /* received message, so try to process straight away */ continue; - if (timeout != USEC_INFINITY) { + if (usec != USEC_INFINITY) { usec_t n; n = now(CLOCK_MONOTONIC); - if (n >= timeout) + if (n >= usec) return -ETIMEDOUT; - left = usec_sub_unsigned(timeout, n); + left = usec_sub_unsigned(usec, n); } else left = USEC_INFINITY; @@ -610,7 +610,7 @@ int sd_netlink_read( int sd_netlink_call( sd_netlink *nl, sd_netlink_message *message, - uint64_t usec, + uint64_t timeout, sd_netlink_message **ret) { uint32_t serial; @@ -624,7 +624,7 @@ int sd_netlink_call( if (r < 0) return r; - return sd_netlink_read(nl, serial, usec, ret); + return sd_netlink_read(nl, serial, timeout, ret); } int sd_netlink_get_events(sd_netlink *nl) { diff --git a/src/libsystemd/sd-network/sd-network.c b/src/libsystemd/sd-network/sd-network.c index 9d95f8b5be2..bb30d720e95 100644 --- a/src/libsystemd/sd-network/sd-network.c +++ b/src/libsystemd/sd-network/sd-network.c @@ -379,12 +379,12 @@ static int monitor_add_inotify_watch(int fd) { return wd; } -int sd_network_monitor_new(sd_network_monitor **m, const char *category) { +int sd_network_monitor_new(sd_network_monitor **ret, const char *category) { _cleanup_close_ int fd = -EBADF; int k; bool good = false; - assert_return(m, -EINVAL); + assert_return(ret, -EINVAL); fd = inotify_init1(IN_NONBLOCK|IN_CLOEXEC); if (fd < 0) @@ -401,7 +401,7 @@ int sd_network_monitor_new(sd_network_monitor **m, const char *category) { if (!good) return -EINVAL; - *m = FD_TO_MONITOR(TAKE_FD(fd)); + *ret = FD_TO_MONITOR(TAKE_FD(fd)); return 0; } diff --git a/src/libsystemd/sd-resolve/resolve-private.h b/src/libsystemd/sd-resolve/resolve-private.h index 7a339f7a35a..3f1edb7d062 100644 --- a/src/libsystemd/sd-resolve/resolve-private.h +++ b/src/libsystemd/sd-resolve/resolve-private.h @@ -4,12 +4,12 @@ #include "sd-resolve.h" int resolve_getaddrinfo_with_destroy_callback( - sd_resolve *resolve, sd_resolve_query **q, + sd_resolve *resolve, sd_resolve_query **ret, const char *node, const char *service, const struct addrinfo *hints, sd_resolve_getaddrinfo_handler_t callback, sd_resolve_destroy_t destroy_callback, void *userdata); int resolve_getnameinfo_with_destroy_callback( - sd_resolve *resolve, sd_resolve_query **q, + sd_resolve *resolve, sd_resolve_query **ret, const struct sockaddr *sa, socklen_t salen, int flags, uint64_t get, sd_resolve_getnameinfo_handler_t callback, sd_resolve_destroy_t destroy_callback, void *userdata); diff --git a/src/libsystemd/sd-resolve/sd-resolve.c b/src/libsystemd/sd-resolve/sd-resolve.c index 978d8b86526..0f189a50444 100644 --- a/src/libsystemd/sd-resolve/sd-resolve.c +++ b/src/libsystemd/sd-resolve/sd-resolve.c @@ -1011,7 +1011,7 @@ static int getaddrinfo_done(sd_resolve_query* q) { int resolve_getnameinfo_with_destroy_callback( sd_resolve *resolve, - sd_resolve_query **ret_query, + sd_resolve_query **ret, const struct sockaddr *sa, socklen_t salen, int flags, uint64_t get, @@ -1033,7 +1033,7 @@ int resolve_getnameinfo_with_destroy_callback( assert_return(callback, -EINVAL); assert_return(!resolve_pid_changed(resolve), -ECHILD); - r = alloc_query(resolve, !ret_query, &q); + r = alloc_query(resolve, !ret, &q); if (r < 0) return r; @@ -1068,8 +1068,8 @@ int resolve_getnameinfo_with_destroy_callback( resolve->n_outstanding++; q->destroy_callback = destroy_callback; - if (ret_query) - *ret_query = q; + if (ret) + *ret = q; TAKE_PTR(q); diff --git a/src/libsystemd/sd-varlink/sd-varlink.c b/src/libsystemd/sd-varlink/sd-varlink.c index 4e294e56b38..563e72dbaed 100644 --- a/src/libsystemd/sd-varlink/sd-varlink.c +++ b/src/libsystemd/sd-varlink/sd-varlink.c @@ -2797,13 +2797,13 @@ _public_ int sd_varlink_dispatch(sd_varlink *v, sd_json_variant *parameters, con return 0; } -_public_ int sd_varlink_bind_reply(sd_varlink *v, sd_varlink_reply_t callback) { +_public_ int sd_varlink_bind_reply(sd_varlink *v, sd_varlink_reply_t reply) { assert_return(v, -EINVAL); - if (callback && v->reply_callback && callback != v->reply_callback) + if (reply && v->reply_callback && reply != v->reply_callback) return varlink_log_errno(v, SYNTHETIC_ERRNO(EBUSY), "A different callback was already set."); - v->reply_callback = callback; + v->reply_callback = reply; return 0; } @@ -4085,23 +4085,23 @@ _public_ int sd_varlink_server_bind_method_many_internal(sd_varlink_server *s, . return r; } -_public_ int sd_varlink_server_bind_connect(sd_varlink_server *s, sd_varlink_connect_t callback) { +_public_ int sd_varlink_server_bind_connect(sd_varlink_server *s, sd_varlink_connect_t connect) { assert_return(s, -EINVAL); - if (callback && s->connect_callback && callback != s->connect_callback) + if (connect && s->connect_callback && connect != s->connect_callback) return varlink_server_log_errno(s, SYNTHETIC_ERRNO(EBUSY), "A different callback was already set."); - s->connect_callback = callback; + s->connect_callback = connect; return 0; } -_public_ int sd_varlink_server_bind_disconnect(sd_varlink_server *s, sd_varlink_disconnect_t callback) { +_public_ int sd_varlink_server_bind_disconnect(sd_varlink_server *s, sd_varlink_disconnect_t disconnect) { assert_return(s, -EINVAL); - if (callback && s->disconnect_callback && callback != s->disconnect_callback) + if (disconnect && s->disconnect_callback && disconnect != s->disconnect_callback) return varlink_server_log_errno(s, SYNTHETIC_ERRNO(EBUSY), "A different callback was already set."); - s->disconnect_callback = callback; + s->disconnect_callback = disconnect; return 0; } diff --git a/src/login/logind-action.c b/src/login/logind-action.c index 0684d5daf02..843bb1a5a08 100644 --- a/src/login/logind-action.c +++ b/src/login/logind-action.c @@ -348,16 +348,16 @@ static int manager_handle_action_secure_attention_key( int manager_handle_action( Manager *m, InhibitWhat inhibit_key, - HandleAction handle, + HandleAction action, bool ignore_inhibited, bool is_edge, const char *action_seat) { assert(m); - assert(handle_action_valid(handle)); + assert(handle_action_valid(action)); /* If the key handling is turned off, don't do anything */ - if (handle == HANDLE_IGNORE) { + if (action == HANDLE_IGNORE) { log_debug("Handling of %s (%s) is disabled, taking no action.", inhibit_key == 0 ? "idle timeout" : inhibit_what_to_string(inhibit_key), is_edge ? "edge" : "level"); @@ -377,14 +377,14 @@ int manager_handle_action( if (inhibit_key > 0) { if (manager_is_inhibited(m, inhibit_key, NULL, MANAGER_IS_INHIBITED_IGNORE_INACTIVE, UID_INVALID, NULL)) { log_debug("Refusing %s operation, %s is inhibited.", - handle_action_to_string(handle), + handle_action_to_string(action), inhibit_what_to_string(inhibit_key)); return 0; } } /* Locking and greeter activation is handled differently from the rest. */ - if (handle == HANDLE_LOCK) { + if (action == HANDLE_LOCK) { if (!is_edge) return 0; @@ -393,13 +393,13 @@ int manager_handle_action( return 1; } - if (handle == HANDLE_SECURE_ATTENTION_KEY) + if (action == HANDLE_SECURE_ATTENTION_KEY) return manager_handle_action_secure_attention_key(m, is_edge, action_seat); - if (HANDLE_ACTION_IS_SLEEP(handle)) - return handle_action_sleep_execute(m, handle, ignore_inhibited, is_edge); + if (HANDLE_ACTION_IS_SLEEP(action)) + return handle_action_sleep_execute(m, action, ignore_inhibited, is_edge); - return handle_action_execute(m, handle, ignore_inhibited, is_edge); + return handle_action_execute(m, action, ignore_inhibited, is_edge); } static const char* const handle_action_verb_table[_HANDLE_ACTION_MAX] = { diff --git a/src/login/logind-action.h b/src/login/logind-action.h index 9e2b562b5d3..f5d0632c233 100644 --- a/src/login/logind-action.h +++ b/src/login/logind-action.h @@ -72,7 +72,7 @@ HandleAction handle_action_sleep_select(Manager *m); int manager_handle_action( Manager *m, InhibitWhat inhibit_key, - HandleAction handle, + HandleAction action, bool ignore_inhibited, bool is_edge, const char *action_seat); @@ -82,7 +82,7 @@ const char* handle_action_verb_to_string(HandleAction h) _const_; const char* handle_action_to_string(HandleAction h) _const_; HandleAction handle_action_from_string(const char *s) _pure_; -const HandleActionData* handle_action_lookup(HandleAction handle); +const HandleActionData* handle_action_lookup(HandleAction action); CONFIG_PARSER_PROTOTYPE(config_parse_handle_action); diff --git a/src/login/logind-inhibit.h b/src/login/logind-inhibit.h index f6d91364620..e1a40cd93a0 100644 --- a/src/login/logind-inhibit.h +++ b/src/login/logind-inhibit.h @@ -84,7 +84,7 @@ static inline bool inhibit_what_is_valid(InhibitWhat w) { return w > 0 && w < _INHIBIT_WHAT_MAX; } -const char* inhibit_what_to_string(InhibitWhat k); +const char* inhibit_what_to_string(InhibitWhat w); int inhibit_what_from_string(const char *s); const char* inhibit_mode_to_string(InhibitMode k); diff --git a/src/login/logind-session.h b/src/login/logind-session.h index 7dfbabf4813..5f85003f7a3 100644 --- a/src/login/logind-session.h +++ b/src/login/logind-session.h @@ -194,7 +194,7 @@ int session_save(Session *s); int session_load(Session *s); int session_kill(Session *s, KillWhom whom, int signo, sd_bus_error *error); -SessionState session_get_state(Session *u); +SessionState session_get_state(Session *s); const char* session_state_to_string(SessionState t) _const_; SessionState session_state_from_string(const char *s) _pure_; diff --git a/src/login/logind-user-dbus.h b/src/login/logind-user-dbus.h index 6e8482f9256..d90cb0cffa9 100644 --- a/src/login/logind-user-dbus.h +++ b/src/login/logind-user-dbus.h @@ -5,7 +5,7 @@ extern const BusObjectImplementation user_object; -char* user_bus_path(User *s); +char* user_bus_path(User *u); int user_send_signal(User *u, bool new_user); int user_send_changed_strv(User *u, char **properties); diff --git a/src/login/logind.h b/src/login/logind.h index bc9ea97d801..332a59f6da6 100644 --- a/src/login/logind.h +++ b/src/login/logind.h @@ -161,7 +161,7 @@ bool manager_shall_kill(Manager *m, const char *user); int manager_get_idle_hint(Manager *m, dual_timestamp *t); -int manager_get_user_by_pid(Manager *m, pid_t pid, User **user); +int manager_get_user_by_pid(Manager *m, pid_t pid, User **ret); int manager_get_session_by_pidref(Manager *m, const PidRef *pid, Session **ret); int manager_get_session_by_leader(Manager *m, const PidRef *pid, Session **ret); @@ -171,7 +171,7 @@ bool manager_is_on_external_power(void); bool manager_all_buttons_ignored(Manager *m); /* gperf lookup function */ -const struct ConfigPerfItem* logind_gperf_lookup(const char *key, GPERF_LEN_TYPE length); +const struct ConfigPerfItem* logind_gperf_lookup(const char *str, GPERF_LEN_TYPE length); int manager_set_lid_switch_ignore(Manager *m, usec_t until); diff --git a/src/machine/machine-dbus.h b/src/machine/machine-dbus.h index 38ea10b295a..afa0d4fd947 100644 --- a/src/machine/machine-dbus.h +++ b/src/machine/machine-dbus.h @@ -10,7 +10,7 @@ typedef enum { extern const BusObjectImplementation machine_object; -char* machine_bus_path(Machine *s); +char* machine_bus_path(Machine *m); int bus_machine_method_unregister(sd_bus_message *message, void *userdata, sd_bus_error *error); int bus_machine_method_terminate(sd_bus_message *message, void *userdata, sd_bus_error *error); diff --git a/src/machine/machine.c b/src/machine/machine.c index 5cbe076506e..89d6fa02339 100644 --- a/src/machine/machine.c +++ b/src/machine/machine.c @@ -804,16 +804,16 @@ void machine_add_to_gc_queue(Machine *m) { manager_enqueue_gc(m->manager); } -MachineState machine_get_state(Machine *s) { - assert(s); +MachineState machine_get_state(Machine *m) { + assert(m); - if (s->class == MACHINE_HOST) + if (m->class == MACHINE_HOST) return MACHINE_RUNNING; - if (s->stopping) + if (m->stopping) return MACHINE_CLOSING; - if (s->scope_job) + if (m->scope_job) return MACHINE_OPENING; return MACHINE_RUNNING; diff --git a/src/machine/machine.h b/src/machine/machine.h index 4bdb049c5fb..b82a67d7032 100644 --- a/src/machine/machine.h +++ b/src/machine/machine.h @@ -105,7 +105,7 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(Machine*, machine_free); void machine_release_unit(Machine *m); -MachineState machine_get_state(Machine *u); +MachineState machine_get_state(Machine *m); const char* machine_class_to_string(MachineClass t) _const_; MachineClass machine_class_from_string(const char *s) _pure_; diff --git a/src/machine/machined-core.c b/src/machine/machined-core.c index 61078d51ec3..8a9e4f6dc40 100644 --- a/src/machine/machined-core.c +++ b/src/machine/machined-core.c @@ -217,7 +217,7 @@ int machine_get_addresses(Machine *machine, struct local_address **ret_addresses _cleanup_free_ struct local_address *addresses = NULL; int n; - n = local_addresses(/* rtnl = */ NULL, /* ifindex = */ 0, AF_UNSPEC, &addresses); + n = local_addresses(/* context = */ NULL, /* ifindex = */ 0, AF_UNSPEC, &addresses); if (n < 0) return log_debug_errno(n, "Failed to get local addresses: %m"); @@ -267,7 +267,7 @@ int machine_get_addresses(Machine *machine, struct local_address **ret_addresses pair[0] = safe_close(pair[0]); - int n = local_addresses(/* rtnl = */ NULL, /* ifindex = */ 0, AF_UNSPEC, &addresses); + int n = local_addresses(/* context = */ NULL, /* ifindex = */ 0, AF_UNSPEC, &addresses); if (n < 0) { log_debug_errno(n, "Failed to get local addresses: %m"); _exit(EXIT_FAILURE); diff --git a/src/machine/machined.h b/src/machine/machined.h index 912b9b0ea78..7c8922ed3e2 100644 --- a/src/machine/machined.h +++ b/src/machine/machined.h @@ -52,8 +52,8 @@ int match_job_removed(sd_bus_message *message, void *userdata, sd_bus_error *err int manager_stop_unit(Manager *manager, const char *unit, sd_bus_error *error, char **job); int manager_kill_unit(Manager *manager, const char *unit, const char *subgroup, int signo, sd_bus_error *error); int manager_unref_unit(Manager *m, const char *unit, sd_bus_error *error); -int manager_unit_is_active(Manager *manager, const char *unit, sd_bus_error *reterr_errno); -int manager_job_is_active(Manager *manager, const char *path, sd_bus_error *reterr_errno); +int manager_unit_is_active(Manager *manager, const char *unit, sd_bus_error *reterr_error); +int manager_job_is_active(Manager *manager, const char *path, sd_bus_error *reterr_error); int manager_find_machine_for_uid(Manager *m, uid_t host_uid, Machine **ret_machine, uid_t *ret_internal_uid); int manager_find_machine_for_gid(Manager *m, gid_t host_gid, Machine **ret_machine, gid_t *ret_internal_gid); diff --git a/src/network/netdev/bareudp.h b/src/network/netdev/bareudp.h index 0b9ef0461da..9fcefbc291e 100644 --- a/src/network/netdev/bareudp.h +++ b/src/network/netdev/bareudp.h @@ -26,6 +26,6 @@ DEFINE_NETDEV_CAST(BAREUDP, BareUDP); extern const NetDevVTable bare_udp_vtable; const char* bare_udp_protocol_to_string(BareUDPProtocol d) _const_; -BareUDPProtocol bare_udp_protocol_from_string(const char *d) _pure_; +BareUDPProtocol bare_udp_protocol_from_string(const char *s) _pure_; CONFIG_PARSER_PROTOTYPE(config_parse_bare_udp_iftype); diff --git a/src/network/netdev/fou-tunnel.h b/src/network/netdev/fou-tunnel.h index 6dc051adbb5..a2cec0506ce 100644 --- a/src/network/netdev/fou-tunnel.h +++ b/src/network/netdev/fou-tunnel.h @@ -35,7 +35,7 @@ DEFINE_NETDEV_CAST(FOU, FouTunnel); extern const NetDevVTable foutnl_vtable; const char* fou_encap_type_to_string(FooOverUDPEncapType d) _const_; -FooOverUDPEncapType fou_encap_type_from_string(const char *d) _pure_; +FooOverUDPEncapType fou_encap_type_from_string(const char *s) _pure_; CONFIG_PARSER_PROTOTYPE(config_parse_fou_encap_type); CONFIG_PARSER_PROTOTYPE(config_parse_fou_tunnel_address); diff --git a/src/network/netdev/geneve.h b/src/network/netdev/geneve.h index 5a03830d98e..d1f52a5d0b5 100644 --- a/src/network/netdev/geneve.h +++ b/src/network/netdev/geneve.h @@ -45,7 +45,7 @@ DEFINE_NETDEV_CAST(GENEVE, Geneve); extern const NetDevVTable geneve_vtable; const char* geneve_df_to_string(GeneveDF d) _const_; -GeneveDF geneve_df_from_string(const char *d) _pure_; +GeneveDF geneve_df_from_string(const char *s) _pure_; CONFIG_PARSER_PROTOTYPE(config_parse_geneve_vni); CONFIG_PARSER_PROTOTYPE(config_parse_geneve_address); diff --git a/src/network/netdev/hsr.h b/src/network/netdev/hsr.h index 62e98a806a3..da3ef994a59 100644 --- a/src/network/netdev/hsr.h +++ b/src/network/netdev/hsr.h @@ -23,6 +23,6 @@ typedef struct Hsr { DEFINE_NETDEV_CAST(HSR, Hsr); extern const NetDevVTable hsr_vtable; -HsrProtocol hsr_protocol_from_string(const char *d) _pure_; +HsrProtocol hsr_protocol_from_string(const char *s) _pure_; CONFIG_PARSER_PROTOTYPE(config_parse_hsr_protocol); diff --git a/src/network/netdev/netdev.h b/src/network/netdev/netdev.h index 8837e6991c0..d36028e4376 100644 --- a/src/network/netdev/netdev.h +++ b/src/network/netdev/netdev.h @@ -235,15 +235,15 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(NetDev*, netdev_unref); bool netdev_is_managed(NetDev *netdev); int netdev_get(Manager *manager, const char *name, NetDev **ret); void link_assign_netdev(Link *link); -int netdev_set_ifindex(NetDev *netdev, sd_netlink_message *newlink); -int netdev_generate_hw_addr(NetDev *netdev, Link *link, const char *name, +int netdev_set_ifindex(NetDev *netdev, sd_netlink_message *message); +int netdev_generate_hw_addr(NetDev *netdev, Link *parent, const char *name, const struct hw_addr_data *hw_addr, struct hw_addr_data *ret); bool netdev_needs_reconfigure(NetDev *netdev, NetDevLocalAddressType type); int link_request_stacked_netdev(Link *link, NetDev *netdev); const char* netdev_kind_to_string(NetDevKind d) _const_; -NetDevKind netdev_kind_from_string(const char *d) _pure_; +NetDevKind netdev_kind_from_string(const char *s) _pure_; static inline NetDevCreateType netdev_get_create_type(NetDev *netdev) { assert(netdev); @@ -256,7 +256,7 @@ CONFIG_PARSER_PROTOTYPE(config_parse_netdev_kind); CONFIG_PARSER_PROTOTYPE(config_parse_netdev_hw_addr); /* gperf */ -const struct ConfigPerfItem* network_netdev_gperf_lookup(const char *key, GPERF_LEN_TYPE length); +const struct ConfigPerfItem* network_netdev_gperf_lookup(const char *str, GPERF_LEN_TYPE length); /* Macros which append INTERFACE= to the message */ diff --git a/src/network/netdev/tunnel.h b/src/network/netdev/tunnel.h index 0d97a71f1e4..7a517e8b2f8 100644 --- a/src/network/netdev/tunnel.h +++ b/src/network/netdev/tunnel.h @@ -123,7 +123,7 @@ extern const NetDevVTable ip6tnl_vtable; extern const NetDevVTable erspan_vtable; const char* tunnel_mode_to_string(TunnelMode d) _const_; -TunnelMode tunnel_mode_from_string(const char *d) _pure_; +TunnelMode tunnel_mode_from_string(const char *s) _pure_; CONFIG_PARSER_PROTOTYPE(config_parse_tunnel_mode); CONFIG_PARSER_PROTOTYPE(config_parse_tunnel_local_address); diff --git a/src/network/netdev/vxlan.h b/src/network/netdev/vxlan.h index 1787eceb911..5e6a5833ab7 100644 --- a/src/network/netdev/vxlan.h +++ b/src/network/netdev/vxlan.h @@ -66,7 +66,7 @@ DEFINE_NETDEV_CAST(VXLAN, VxLan); extern const NetDevVTable vxlan_vtable; const char* df_to_string(VxLanDF d) _const_; -VxLanDF df_from_string(const char *d) _pure_; +VxLanDF df_from_string(const char *s) _pure_; CONFIG_PARSER_PROTOTYPE(config_parse_vxlan_address); CONFIG_PARSER_PROTOTYPE(config_parse_port_range); diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c index e6088106753..97d72788623 100644 --- a/src/network/networkd-address.c +++ b/src/network/networkd-address.c @@ -826,7 +826,7 @@ static int address_update(Address *address) { return r; } - link_update_operstate(link, /* also_update_bond_master = */ true); + link_update_operstate(link, /* also_update_master = */ true); link_check_ready(link); return 0; } @@ -901,7 +901,7 @@ static int address_drop(Address *in, bool removed_by_us) { } } - link_update_operstate(link, /* also_update_bond_master = */ true); + link_update_operstate(link, /* also_update_master = */ true); link_check_ready(link); return 0; } diff --git a/src/network/networkd-conf.h b/src/network/networkd-conf.h index ccd574fdbf2..244193b4954 100644 --- a/src/network/networkd-conf.h +++ b/src/network/networkd-conf.h @@ -9,4 +9,4 @@ int manager_parse_config_file(Manager *m); -const struct ConfigPerfItem* networkd_gperf_lookup(const char *key, GPERF_LEN_TYPE length); +const struct ConfigPerfItem* networkd_gperf_lookup(const char *str, GPERF_LEN_TYPE length); diff --git a/src/network/networkd-dhcp-common.h b/src/network/networkd-dhcp-common.h index 859c174f977..693696e77e2 100644 --- a/src/network/networkd-dhcp-common.h +++ b/src/network/networkd-dhcp-common.h @@ -74,7 +74,7 @@ static inline bool in6_prefix_is_filtered(const struct in6_addr *prefix, uint8_t int link_get_captive_portal(Link *link, const char **ret); const char* dhcp_option_data_type_to_string(DHCPOptionDataType d) _const_; -DHCPOptionDataType dhcp_option_data_type_from_string(const char *d) _pure_; +DHCPOptionDataType dhcp_option_data_type_from_string(const char *s) _pure_; CONFIG_PARSER_PROTOTYPE(config_parse_dhcp); CONFIG_PARSER_PROTOTYPE(config_parse_dhcp_route_metric); diff --git a/src/network/networkd-link.h b/src/network/networkd-link.h index 8c5648d8d0a..51b6642bb64 100644 --- a/src/network/networkd-link.h +++ b/src/network/networkd-link.h @@ -225,7 +225,7 @@ void link_enter_failed(Link *link); void link_set_state(Link *link, LinkState state); void link_check_ready(Link *link); -void link_update_operstate(Link *link, bool also_update_bond_master); +void link_update_operstate(Link *link, bool also_update_master); bool link_has_carrier(Link *link); bool link_multicast_enabled(Link *link); diff --git a/src/network/networkd-manager.h b/src/network/networkd-manager.h index 871898abe60..4017a92abd9 100644 --- a/src/network/networkd-manager.h +++ b/src/network/networkd-manager.h @@ -144,7 +144,7 @@ int manager_enumerate_internal( int manager_enumerate(Manager *m); int manager_set_hostname(Manager *m, const char *hostname); -int manager_set_timezone(Manager *m, const char *timezone); +int manager_set_timezone(Manager *m, const char *tz); int manager_reload(Manager *m, sd_bus_message *message); diff --git a/src/network/networkd-network.h b/src/network/networkd-network.h index 4ec2783e99f..f7e40915663 100644 --- a/src/network/networkd-network.h +++ b/src/network/networkd-network.h @@ -441,7 +441,7 @@ CONFIG_PARSER_PROTOTYPE(config_parse_activation_policy); CONFIG_PARSER_PROTOTYPE(config_parse_link_group); CONFIG_PARSER_PROTOTYPE(config_parse_ignore_carrier_loss); -const struct ConfigPerfItem* network_network_gperf_lookup(const char *key, GPERF_LEN_TYPE length); +const struct ConfigPerfItem* network_network_gperf_lookup(const char *str, GPERF_LEN_TYPE length); const char* keep_configuration_to_string(KeepConfiguration i) _const_; KeepConfiguration keep_configuration_from_string(const char *s) _pure_; diff --git a/src/network/networkd-route-util.h b/src/network/networkd-route-util.h index 1c037f7a073..0540bfbb4cb 100644 --- a/src/network/networkd-route-util.h +++ b/src/network/networkd-route-util.h @@ -44,7 +44,7 @@ int route_protocol_full_to_string_alloc(int t, char **ret); int route_flags_to_string_alloc(uint32_t flags, char **ret); -int manager_get_route_table_from_string(const Manager *m, const char *table, uint32_t *ret); +int manager_get_route_table_from_string(const Manager *m, const char *s, uint32_t *ret); int manager_get_route_table_to_string(const Manager *m, uint32_t table, bool append_num, char **ret); CONFIG_PARSER_PROTOTYPE(config_parse_route_table_names); diff --git a/src/network/tc/qdisc.h b/src/network/tc/qdisc.h index 51929d67f79..207d59f47b1 100644 --- a/src/network/tc/qdisc.h +++ b/src/network/tc/qdisc.h @@ -81,7 +81,7 @@ int qdisc_new_static(QDiscKind kind, Network *network, const char *filename, uns void qdisc_mark_recursive(QDisc *qdisc); void link_qdisc_drop_marked(Link *link); -int link_find_qdisc(Link *link, uint32_t handle, const char *kind, QDisc **qdisc); +int link_find_qdisc(Link *link, uint32_t handle, const char *kind, QDisc **ret); int link_request_qdisc(Link *link, const QDisc *qdisc); diff --git a/src/network/tc/tc-util.h b/src/network/tc/tc-util.h index d3a4bd173e0..e3a63d08b2b 100644 --- a/src/network/tc/tc-util.h +++ b/src/network/tc/tc-util.h @@ -8,7 +8,7 @@ int tc_init(double *ret_ticks_in_usec, uint32_t *ret_hz); int tc_time_to_tick(usec_t t, uint32_t *ret); -int parse_tc_percent(const char *s, uint32_t *percent); +int parse_tc_percent(const char *s, uint32_t *ret_fraction); int tc_transmit_time(uint64_t rate, uint32_t size, uint32_t *ret); int tc_fill_ratespec_and_table(struct tc_ratespec *rate, uint32_t *rtab, uint32_t mtu); int parse_handle(const char *t, uint32_t *ret); diff --git a/src/nspawn/nspawn-oci.h b/src/nspawn/nspawn-oci.h index 7c30afbcce1..0125851a4ca 100644 --- a/src/nspawn/nspawn-oci.h +++ b/src/nspawn/nspawn-oci.h @@ -4,4 +4,4 @@ #include "shared-forward.h" #include "nspawn-settings.h" -int oci_load(FILE *f, const char *path, Settings **ret); +int oci_load(FILE *f, const char *bundle, Settings **ret); diff --git a/src/nspawn/nspawn-settings.h b/src/nspawn/nspawn-settings.h index 5d3891647d5..a677578cd8e 100644 --- a/src/nspawn/nspawn-settings.h +++ b/src/nspawn/nspawn-settings.h @@ -249,7 +249,7 @@ int settings_allocate_properties(Settings *s); DEFINE_TRIVIAL_CLEANUP_FUNC(Settings*, settings_free); -const struct ConfigPerfItem* nspawn_gperf_lookup(const char *key, GPERF_LEN_TYPE length); +const struct ConfigPerfItem* nspawn_gperf_lookup(const char *str, GPERF_LEN_TYPE length); CONFIG_PARSER_PROTOTYPE(config_parse_capability); CONFIG_PARSER_PROTOTYPE(config_parse_expose_port); diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c index ae081f88f25..9a896951e4b 100644 --- a/src/nspawn/nspawn.c +++ b/src/nspawn/nspawn.c @@ -4140,7 +4140,7 @@ static int outer_child( dirs, chown_uid, chown_range, - /* host_owner= */ UID_INVALID, + /* source_owner= */ UID_INVALID, /* dest_owner= */ UID_INVALID, mapping); if (r == -EINVAL || ERRNO_IS_NEG_NOT_SUPPORTED(r)) { diff --git a/src/nsresourced/userns-registry.h b/src/nsresourced/userns-registry.h index 9d6b398b656..fee2623a3b5 100644 --- a/src/nsresourced/userns-registry.h +++ b/src/nsresourced/userns-registry.h @@ -39,7 +39,7 @@ int userns_registry_lock(int dir_fd); int userns_registry_load_by_start_uid(int dir_fd, uid_t start, UserNamespaceInfo **ret); int userns_registry_load_by_start_gid(int dir_fd, gid_t start, UserNamespaceInfo **ret); -int userns_registry_load_by_userns_inode(int dir_fd, uint64_t userns, UserNamespaceInfo **ret); +int userns_registry_load_by_userns_inode(int dir_fd, uint64_t inode, UserNamespaceInfo **ret); int userns_registry_load_by_name(int dir_fd, const char *name, UserNamespaceInfo **ret); int userns_registry_store(int dir_fd, UserNamespaceInfo *info); diff --git a/src/nsresourced/userns-restrict.c b/src/nsresourced/userns-restrict.c index 48b531677c6..6a8306de66a 100644 --- a/src/nsresourced/userns-restrict.c +++ b/src/nsresourced/userns-restrict.c @@ -317,29 +317,27 @@ int userns_restrict_put_by_fd( #endif } -int userns_restrict_reset_by_inode( - struct userns_restrict_bpf *obj, - uint64_t ino) { +int userns_restrict_reset_by_inode(struct userns_restrict_bpf *obj, uint64_t userns_inode) { #if HAVE_VMLINUX_H int r, outer_map_fd; unsigned u; assert(obj); - assert(ino != 0); + assert(userns_inode != 0); - if (ino > UINT32_MAX) /* inodes larger than 32bit are definitely not included in our map, exit early */ + if (userns_inode > UINT32_MAX) /* inodes larger than 32bit are definitely not included in our map, exit early */ return 0; outer_map_fd = sym_bpf_map__fd(obj->maps.userns_mnt_id_hash); if (outer_map_fd < 0) return log_debug_errno(outer_map_fd, "Failed to get outer BPF map fd: %m"); - u = (uint32_t) ino; + u = (uint32_t) userns_inode; r = sym_bpf_map_delete_elem(outer_map_fd, &u); if (r < 0) - return log_debug_errno(r, "Failed to remove entry for inode %" PRIu64 " from outer map: %m", ino); + return log_debug_errno(r, "Failed to remove entry for inode %" PRIu64 " from outer map: %m", userns_inode); return 0; #else diff --git a/src/oom/oomd-util.h b/src/oom/oomd-util.h index a94d5c0d055..45f868bc5ce 100644 --- a/src/oom/oomd-util.h +++ b/src/oom/oomd-util.h @@ -129,7 +129,7 @@ int oomd_kill_by_pgscan_rate(Hashmap *h, const char *prefix, bool dry_run, char int oomd_kill_by_swap_usage(Hashmap *h, uint64_t threshold_usage, bool dry_run, char **ret_selected); int oomd_cgroup_context_acquire(const char *path, OomdCGroupContext **ret); -int oomd_system_context_acquire(const char *proc_swaps_path, OomdSystemContext *ret); +int oomd_system_context_acquire(const char *proc_meminfo_path, OomdSystemContext *ret); /* Get the OomdCGroupContext of `path` and insert it into `new_h`. The key for the inserted context will be `path`. * diff --git a/src/portable/portable.h b/src/portable/portable.h index e001ba7795a..14814e74029 100644 --- a/src/portable/portable.h +++ b/src/portable/portable.h @@ -65,19 +65,57 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(PortableMetadata*, portable_metadata_unref); int portable_metadata_hashmap_to_sorted_array(Hashmap *unit_files, PortableMetadata ***ret); -int portable_extract(RuntimeScope scope, const char *image, char **matches, char **extension_image_paths, const ImagePolicy *image_policy, PortableFlags flags, PortableMetadata **ret_os_release, OrderedHashmap **ret_extension_releases, Hashmap **ret_unit_files, char ***ret_valid_prefixes, sd_bus_error *error); - -int portable_attach(RuntimeScope scope, sd_bus *bus, const char *name_or_path, char **matches, const char *profile, char **extension_images, const ImagePolicy* image_policy, PortableFlags flags, PortableChange **changes, size_t *n_changes, sd_bus_error *error); -int portable_detach(RuntimeScope scope, sd_bus *bus, const char *name_or_path, char **extension_image_paths, PortableFlags flags, PortableChange **changes, size_t *n_changes, sd_bus_error *error); - -int portable_get_state(RuntimeScope scope, sd_bus *bus, const char *name_or_path, char **extension_image_paths, PortableFlags flags, PortableState *ret, sd_bus_error *error); +int portable_extract( + RuntimeScope scope, + const char *name_or_path, + char **matches, + char **extension_image_paths, + const ImagePolicy *image_policy, + PortableFlags flags, + PortableMetadata **ret_os_release, + OrderedHashmap **ret_extension_releases, + Hashmap **ret_unit_files, + char ***ret_valid_prefixes, + sd_bus_error *error); + +int portable_attach( + RuntimeScope scope, + sd_bus *bus, + const char *name_or_path, + char **matches, + const char *profile, + char **extension_image_paths, + const ImagePolicy* image_policy, + PortableFlags flags, + PortableChange **changes, + size_t *n_changes, + sd_bus_error *error); + +int portable_detach( + RuntimeScope scope, + sd_bus *bus, + const char *name_or_path, + char **extension_image_paths, + PortableFlags flags, + PortableChange **changes, + size_t *n_changes, + sd_bus_error *error); + +int portable_get_state( + RuntimeScope scope, + sd_bus *bus, + const char *name_or_path, + char **extension_image_paths, + PortableFlags flags, + PortableState *ret, + sd_bus_error *error); int portable_get_profiles(char ***ret); void portable_changes_free(PortableChange *changes, size_t n_changes); const char* portable_change_type_to_string(int t) _const_; -int portable_change_type_from_string(const char *t) _pure_; +int portable_change_type_from_string(const char *s) _pure_; const char* portable_state_to_string(PortableState t) _const_; -PortableState portable_state_from_string(const char *t) _pure_; +PortableState portable_state_from_string(const char *s) _pure_; diff --git a/src/resolve/resolved-conf.h b/src/resolve/resolved-conf.h index 70c7b03aa71..71899d36f68 100644 --- a/src/resolve/resolved-conf.h +++ b/src/resolve/resolved-conf.h @@ -13,7 +13,7 @@ typedef enum ResolveConfigSource { int manager_parse_config_file(Manager *m); -const struct ConfigPerfItem* resolved_gperf_lookup(const char *key, GPERF_LEN_TYPE length); +const struct ConfigPerfItem* resolved_gperf_lookup(const char *str, GPERF_LEN_TYPE length); CONFIG_PARSER_PROTOTYPE(config_parse_dns_servers); CONFIG_PARSER_PROTOTYPE(config_parse_search_domains); diff --git a/src/resolve/resolved-dns-delegate.h b/src/resolve/resolved-dns-delegate.h index ccf3d225c62..dfb8429de21 100644 --- a/src/resolve/resolved-dns-delegate.h +++ b/src/resolve/resolved-dns-delegate.h @@ -39,7 +39,7 @@ void dns_delegate_next_dns_server(DnsDelegate *d, DnsServer *if_current); int manager_load_delegates(Manager *m); -const struct ConfigPerfItem* resolved_dns_delegate_gperf_lookup(const char *key, GPERF_LEN_TYPE length); +const struct ConfigPerfItem* resolved_dns_delegate_gperf_lookup(const char *str, GPERF_LEN_TYPE length); CONFIG_PARSER_PROTOTYPE(config_parse_delegate_dns_servers); CONFIG_PARSER_PROTOTYPE(config_parse_delegate_domains); diff --git a/src/resolve/resolved-dns-query.h b/src/resolve/resolved-dns-query.h index b8b7d40525c..f0c99ae94b9 100644 --- a/src/resolve/resolved-dns-query.h +++ b/src/resolve/resolved-dns-query.h @@ -136,7 +136,7 @@ DEFINE_TRIVIAL_CLEANUP_FUNC(DnsQueryCandidate*, dns_query_candidate_unref); void dns_query_candidate_notify(DnsQueryCandidate *c); -int dns_query_new(Manager *m, DnsQuery **q, DnsQuestion *question_utf8, DnsQuestion *question_idna, DnsPacket *question_bypass, int family, uint64_t flags); +int dns_query_new(Manager *m, DnsQuery **ret, DnsQuestion *question_utf8, DnsQuestion *question_idna, DnsPacket *question_bypass, int ifindex, uint64_t flags); DnsQuery *dns_query_free(DnsQuery *q); int dns_query_make_auxiliary(DnsQuery *q, DnsQuery *auxiliary_for); diff --git a/src/resolve/resolved-dns-server.h b/src/resolve/resolved-dns-server.h index 7dfa0eae66c..403902da832 100644 --- a/src/resolve/resolved-dns-server.h +++ b/src/resolve/resolved-dns-server.h @@ -108,10 +108,10 @@ int dns_server_new( Link *link, DnsDelegate *delegate, int family, - const union in_addr_union *address, + const union in_addr_union *in_addr, uint16_t port, int ifindex, - const char *server_string, + const char *server_name, ResolveConfigSource config_source); DnsServer* dns_server_ref(DnsServer *s); @@ -148,7 +148,7 @@ DnsServer *dns_server_find(DnsServer *first, int family, const union in_addr_uni void dns_server_unlink_all(DnsServer *first); void dns_server_unlink_on_reload(DnsServer *server); bool dns_server_unlink_marked(DnsServer *first); -void dns_server_mark_all(DnsServer *first); +void dns_server_mark_all(DnsServer *server); int manager_parse_search_domains_and_warn(Manager *m, const char *string); int manager_parse_dns_server_string_and_warn(Manager *m, DnsServerType type, const char *string); diff --git a/src/resolve/resolved-dns-trust-anchor.h b/src/resolve/resolved-dns-trust-anchor.h index 640aa4cb8b0..204c3e838a2 100644 --- a/src/resolve/resolved-dns-trust-anchor.h +++ b/src/resolve/resolved-dns-trust-anchor.h @@ -14,7 +14,7 @@ typedef struct DnsTrustAnchor { int dns_trust_anchor_load(DnsTrustAnchor *d); void dns_trust_anchor_flush(DnsTrustAnchor *d); -int dns_trust_anchor_lookup_positive(DnsTrustAnchor *d, const DnsResourceKey* key, DnsAnswer **answer); +int dns_trust_anchor_lookup_positive(DnsTrustAnchor *d, const DnsResourceKey* key, DnsAnswer **ret); int dns_trust_anchor_lookup_negative(DnsTrustAnchor *d, const char *name); int dns_trust_anchor_check_revoked(DnsTrustAnchor *d, DnsResourceRecord *dnskey, DnsAnswer *rrs); diff --git a/src/resolve/resolved-dnssd.h b/src/resolve/resolved-dnssd.h index 98ac3dec765..aa5a80b0bdb 100644 --- a/src/resolve/resolved-dnssd.h +++ b/src/resolve/resolved-dnssd.h @@ -61,7 +61,7 @@ int dnssd_txt_item_new_from_data(const char *key, const void *data, size_t size, int dnssd_update_rrs(DnssdRegisteredService *s); int dnssd_signal_conflict(Manager *manager, const char *name); -const struct ConfigPerfItem* resolved_dnssd_gperf_lookup(const char *key, GPERF_LEN_TYPE length); +const struct ConfigPerfItem* resolved_dnssd_gperf_lookup(const char *str, GPERF_LEN_TYPE length); CONFIG_PARSER_PROTOTYPE(config_parse_dnssd_name); CONFIG_PARSER_PROTOTYPE(config_parse_dnssd_subtype); diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c index e3a423876c8..221e4cf72a3 100644 --- a/src/resolve/resolved-manager.c +++ b/src/resolve/resolved-manager.c @@ -1618,20 +1618,20 @@ int manager_is_own_hostname(Manager *m, const char *name) { return 0; } -int manager_compile_dns_servers(Manager *m, OrderedSet **dns) { +int manager_compile_dns_servers(Manager *m, OrderedSet **servers) { Link *l; int r; assert(m); - assert(dns); + assert(servers); - r = ordered_set_ensure_allocated(dns, &dns_server_hash_ops); + r = ordered_set_ensure_allocated(servers, &dns_server_hash_ops); if (r < 0) return r; /* First add the system-wide servers and domains */ LIST_FOREACH(servers, s, m->dns_servers) { - r = ordered_set_put(*dns, s); + r = ordered_set_put(*servers, s); if (r == -EEXIST) continue; if (r < 0) @@ -1641,7 +1641,7 @@ int manager_compile_dns_servers(Manager *m, OrderedSet **dns) { /* Then, add the per-link servers */ HASHMAP_FOREACH(l, m->links) LIST_FOREACH(servers, s, l->dns_servers) { - r = ordered_set_put(*dns, s); + r = ordered_set_put(*servers, s); if (r == -EEXIST) continue; if (r < 0) @@ -1652,7 +1652,7 @@ int manager_compile_dns_servers(Manager *m, OrderedSet **dns) { DnsDelegate *d; HASHMAP_FOREACH(d, m->delegates) LIST_FOREACH(servers, s, d->dns_servers) { - r = ordered_set_put(*dns, s); + r = ordered_set_put(*servers, s); if (r == -EEXIST) continue; if (r < 0) @@ -1660,9 +1660,9 @@ int manager_compile_dns_servers(Manager *m, OrderedSet **dns) { } /* If we found nothing, add the fallback servers */ - if (ordered_set_isempty(*dns)) { + if (ordered_set_isempty(*servers)) { LIST_FOREACH(servers, s, m->fallback_dns_servers) { - r = ordered_set_put(*dns, s); + r = ordered_set_put(*servers, s); if (r == -EEXIST) continue; if (r < 0) diff --git a/src/shared/acl-util.h b/src/shared/acl-util.h index 5ff7cc47bc5..b3c1bfa4f92 100644 --- a/src/shared/acl-util.h +++ b/src/shared/acl-util.h @@ -51,7 +51,7 @@ int parse_acl( acl_t *ret_acl_access_exec, acl_t *ret_acl_default, bool want_mask); -int acls_for_file(const char *path, acl_type_t type, acl_t new, acl_t *ret); +int acls_for_file(const char *path, acl_type_t type, acl_t acl, acl_t *ret); int fd_add_uid_acl_permission(int fd, uid_t uid, unsigned mask); int fd_acl_make_read_only(int fd); diff --git a/src/shared/barrier.h b/src/shared/barrier.h index 9d100e5504e..e95e5589d73 100644 --- a/src/shared/barrier.h +++ b/src/shared/barrier.h @@ -32,7 +32,7 @@ struct Barrier { #define BARRIER_NULL {-EBADF, -EBADF, {-EBADF, -EBADF}, 0} -int barrier_create(Barrier *obj); +int barrier_create(Barrier *b); Barrier* barrier_destroy(Barrier *b); DEFINE_TRIVIAL_CLEANUP_FUNC(Barrier*, barrier_destroy); diff --git a/src/shared/blockdev-util.h b/src/shared/blockdev-util.h index eddb521e4a1..871596f618c 100644 --- a/src/shared/blockdev-util.h +++ b/src/shared/blockdev-util.h @@ -30,10 +30,10 @@ int block_get_whole_disk(dev_t d, dev_t *ret); int block_get_originating(dev_t d, dev_t *ret); int get_block_device_fd(int fd, dev_t *ret); -int get_block_device(const char *path, dev_t *dev); +int get_block_device(const char *path, dev_t *ret); -int get_block_device_harder_fd(int fd, dev_t *dev); -int get_block_device_harder(const char *path, dev_t *dev); +int get_block_device_harder_fd(int fd, dev_t *ret); +int get_block_device_harder(const char *path, dev_t *ret); int lock_whole_block_device(dev_t devt, int open_flags, int operation); diff --git a/src/shared/bond-util.h b/src/shared/bond-util.h index 0830c31d842..49260d1dfa1 100644 --- a/src/shared/bond-util.h +++ b/src/shared/bond-util.h @@ -81,25 +81,25 @@ typedef enum BondPrimaryReselect { } BondPrimaryReselect; const char* bond_mode_to_string(BondMode d) _const_; -BondMode bond_mode_from_string(const char *d) _pure_; +BondMode bond_mode_from_string(const char *s) _pure_; const char* bond_xmit_hash_policy_to_string(BondXmitHashPolicy d) _const_; -BondXmitHashPolicy bond_xmit_hash_policy_from_string(const char *d) _pure_; +BondXmitHashPolicy bond_xmit_hash_policy_from_string(const char *s) _pure_; const char* bond_lacp_rate_to_string(BondLacpRate d) _const_; -BondLacpRate bond_lacp_rate_from_string(const char *d) _pure_; +BondLacpRate bond_lacp_rate_from_string(const char *s) _pure_; const char* bond_fail_over_mac_to_string(BondFailOverMac d) _const_; -BondFailOverMac bond_fail_over_mac_from_string(const char *d) _pure_; +BondFailOverMac bond_fail_over_mac_from_string(const char *s) _pure_; const char* bond_ad_select_to_string(BondAdSelect d) _const_; -BondAdSelect bond_ad_select_from_string(const char *d) _pure_; +BondAdSelect bond_ad_select_from_string(const char *s) _pure_; const char* bond_arp_validate_to_string(BondArpValidate d) _const_; -BondArpValidate bond_arp_validate_from_string(const char *d) _pure_; +BondArpValidate bond_arp_validate_from_string(const char *s) _pure_; const char* bond_arp_all_targets_to_string(BondArpAllTargets d) _const_; -BondArpAllTargets bond_arp_all_targets_from_string(const char *d) _pure_; +BondArpAllTargets bond_arp_all_targets_from_string(const char *s) _pure_; const char* bond_primary_reselect_to_string(BondPrimaryReselect d) _const_; -BondPrimaryReselect bond_primary_reselect_from_string(const char *d) _pure_; +BondPrimaryReselect bond_primary_reselect_from_string(const char *s) _pure_; diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c index 46143020feb..b6b5d6e50b2 100644 --- a/src/shared/bootspec.c +++ b/src/shared/bootspec.c @@ -435,21 +435,21 @@ int boot_config_load_type1( const char *root, const BootEntrySource source, const char *dir, - const char *fname) { + const char *filename) { int r; assert(config); assert(f); assert(root); assert(dir); - assert(fname); + assert(filename); if (!GREEDY_REALLOC(config->entries, config->n_entries + 1)) return log_oom(); BootEntry *entry = config->entries + config->n_entries; - r = boot_entry_load_type1(f, root, source, dir, fname, entry); + r = boot_entry_load_type1(f, root, source, dir, filename, entry); if (r < 0) return r; config->n_entries++; diff --git a/src/shared/bootspec.h b/src/shared/bootspec.h index 6b374c075f0..a62a3f0b4ef 100644 --- a/src/shared/bootspec.h +++ b/src/shared/bootspec.h @@ -125,12 +125,12 @@ int boot_config_load_type1( const char *root, BootEntrySource source, const char *dir, - const char *id); + const char *filename); int boot_config_finalize(BootConfig *config); int boot_config_load(BootConfig *config, const char *esp_path, const char *xbootldr_path); int boot_config_load_auto(BootConfig *config, const char *override_esp_path, const char *override_xbootldr_path); -int boot_config_augment_from_loader(BootConfig *config, char **list, bool auto_only); +int boot_config_augment_from_loader(BootConfig *config, char **found_by_loader, bool auto_only); int boot_config_select_special_entries(BootConfig *config, bool skip_efivars); diff --git a/src/shared/bpf-link.h b/src/shared/bpf-link.h index efc3cb9850e..79da1c2fea2 100644 --- a/src/shared/bpf-link.h +++ b/src/shared/bpf-link.h @@ -11,7 +11,7 @@ bool bpf_can_link_program(struct bpf_program *prog); int bpf_serialize_link(FILE *f, FDSet *fds, const char *key, struct bpf_link *link); -struct bpf_link* bpf_link_free(struct bpf_link *p); +struct bpf_link* bpf_link_free(struct bpf_link *link); DEFINE_TRIVIAL_CLEANUP_FUNC(struct bpf_link *, bpf_link_free); struct ring_buffer* bpf_ring_buffer_free(struct ring_buffer *rb); diff --git a/src/shared/bpf-program.h b/src/shared/bpf-program.h index 4156bc8760f..171faa99804 100644 --- a/src/shared/bpf-program.h +++ b/src/shared/bpf-program.h @@ -30,7 +30,7 @@ int bpf_program_new(uint32_t prog_type, const char *prog_name, BPFProgram **ret) int bpf_program_new_from_bpffs_path(const char *path, BPFProgram **ret); BPFProgram *bpf_program_free(BPFProgram *p); -int bpf_program_add_instructions(BPFProgram *p, const struct bpf_insn *insn, size_t count); +int bpf_program_add_instructions(BPFProgram *p, const struct bpf_insn *instructions, size_t count); int bpf_program_load_kernel(BPFProgram *p, char *log_buf, size_t log_size); int bpf_program_load_from_bpf_fs(BPFProgram *p, const char *path); diff --git a/src/shared/bridge-util.h b/src/shared/bridge-util.h index 245657a2265..a166c97d35d 100644 --- a/src/shared/bridge-util.h +++ b/src/shared/bridge-util.h @@ -16,4 +16,4 @@ typedef enum BridgeState { } BridgeState; const char* bridge_state_to_string(BridgeState d) _const_; -BridgeState bridge_state_from_string(const char *d) _pure_; +BridgeState bridge_state_from_string(const char *s) _pure_; diff --git a/src/shared/btrfs-util.h b/src/shared/btrfs-util.h index 0d90ea27391..55fb07656a5 100644 --- a/src/shared/btrfs-util.h +++ b/src/shared/btrfs-util.h @@ -91,17 +91,17 @@ int btrfs_subvol_get_id(int fd, const char *subvolume, uint64_t *ret); int btrfs_subvol_get_id_fd(int fd, uint64_t *ret); int btrfs_subvol_get_parent(int fd, uint64_t subvol_id, uint64_t *ret); -int btrfs_subvol_get_info_fd(int fd, uint64_t subvol_id, BtrfsSubvolInfo *info); +int btrfs_subvol_get_info_fd(int fd, uint64_t subvol_id, BtrfsSubvolInfo *ret); int btrfs_subvol_find_subtree_qgroup(int fd, uint64_t subvol_id, uint64_t *ret); -int btrfs_subvol_get_subtree_quota(const char *path, uint64_t subvol_id, BtrfsQuotaInfo *quota); -int btrfs_subvol_get_subtree_quota_fd(int fd, uint64_t subvol_id, BtrfsQuotaInfo *quota); +int btrfs_subvol_get_subtree_quota(const char *path, uint64_t subvol_id, BtrfsQuotaInfo *ret); +int btrfs_subvol_get_subtree_quota_fd(int fd, uint64_t subvol_id, BtrfsQuotaInfo *ret); int btrfs_subvol_set_subtree_quota_limit(const char *path, uint64_t subvol_id, uint64_t referenced_max); int btrfs_subvol_set_subtree_quota_limit_fd(int fd, uint64_t subvol_id, uint64_t referenced_max); -int btrfs_subvol_auto_qgroup_fd(int fd, uint64_t subvol_id, bool new_qgroup); +int btrfs_subvol_auto_qgroup_fd(int fd, uint64_t subvol_id, bool insert_intermediary_qgroup); int btrfs_subvol_auto_qgroup(const char *path, uint64_t subvol_id, bool create_intermediary_qgroup); int btrfs_subvol_make_default(const char *path); @@ -123,8 +123,8 @@ int btrfs_qgroup_unassign(int fd, uint64_t child, uint64_t parent); int btrfs_qgroup_find_parents(int fd, uint64_t qgroupid, uint64_t **ret); -int btrfs_qgroup_get_quota_fd(int fd, uint64_t qgroupid, BtrfsQuotaInfo *quota); -int btrfs_qgroup_get_quota(const char *path, uint64_t qgroupid, BtrfsQuotaInfo *quota); +int btrfs_qgroup_get_quota_fd(int fd, uint64_t qgroupid, BtrfsQuotaInfo *ret); +int btrfs_qgroup_get_quota(const char *path, uint64_t qgroupid, BtrfsQuotaInfo *ret); int btrfs_log_dev_root(int level, int ret, const char *p); diff --git a/src/shared/bus-log-control-api.h b/src/shared/bus-log-control-api.h index 35f9251d319..f651d47679e 100644 --- a/src/shared/bus-log-control-api.h +++ b/src/shared/bus-log-control-api.h @@ -7,10 +7,45 @@ extern const BusObjectImplementation log_control_object; int bus_log_control_api_register(sd_bus *bus); -int bus_property_get_log_level(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *reterr_error); -int bus_property_set_log_level(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *value, void *userdata, sd_bus_error *reterr_error); +int bus_property_get_log_level( + sd_bus *bus, + const char *path, + const char *interface, + const char *property, + sd_bus_message *reply, + void *userdata, + sd_bus_error *reterr_error); +int bus_property_set_log_level( + sd_bus *bus, + const char *path, + const char *interface, + const char *property, + sd_bus_message *value, + void *userdata, + sd_bus_error *reterr_error); -int bus_property_get_log_target(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *reterr_error); -int bus_property_set_log_target(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *reterr_error); +int bus_property_get_log_target( + sd_bus *bus, + const char *path, + const char *interface, + const char *property, + sd_bus_message *reply, + void *userdata, + sd_bus_error *reterr_error); +int bus_property_set_log_target( + sd_bus *bus, + const char *path, + const char *interface, + const char *property, + sd_bus_message *value, + void *userdata, + sd_bus_error *reterr_error); -int bus_property_get_syslog_identifier(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *reterr_error); +int bus_property_get_syslog_identifier( + sd_bus *bus, + const char *path, + const char *interface, + const char *property, + sd_bus_message *reply, + void *userdata, + sd_bus_error *reterr_error); diff --git a/src/shared/bus-util.h b/src/shared/bus-util.h index b14f93d1bb5..cbaf7b2d7cf 100644 --- a/src/shared/bus-util.h +++ b/src/shared/bus-util.h @@ -35,8 +35,8 @@ int bus_connect_user_systemd(sd_bus **ret); int bus_connect_capsule_systemd(const char *capsule, sd_bus **ret); int bus_connect_capsule_bus(const char *capsule, sd_bus **ret); -int bus_connect_transport(BusTransport transport, const char *host, RuntimeScope runtime_scope, sd_bus **bus); -int bus_connect_transport_systemd(BusTransport transport, const char *host, RuntimeScope runtime_scope, sd_bus **bus); +int bus_connect_transport(BusTransport transport, const char *host, RuntimeScope runtime_scope, sd_bus **ret); +int bus_connect_transport_systemd(BusTransport transport, const char *host, RuntimeScope runtime_scope, sd_bus **ret); int bus_log_address_error(int r, BusTransport transport); int bus_log_connect_full(int log_level, int r, BusTransport transport, RuntimeScope scope); diff --git a/src/shared/condition.h b/src/shared/condition.h index a258db6a8e8..df96ade91ea 100644 --- a/src/shared/condition.h +++ b/src/shared/condition.h @@ -73,7 +73,7 @@ typedef struct Condition { Condition* condition_new(ConditionType type, const char *parameter, bool trigger, bool negate); Condition* condition_free(Condition *c); -Condition* condition_free_list_type(Condition *first, ConditionType type); +Condition* condition_free_list_type(Condition *head, ConditionType type); static inline Condition* condition_free_list(Condition *first) { return condition_free_list_type(first, _CONDITION_TYPE_INVALID); } @@ -85,7 +85,7 @@ typedef const char* (*condition_to_string_t)(ConditionType t) _const_; bool condition_test_list(Condition *first, char **env, condition_to_string_t to_string, condition_test_logger_t logger, void *userdata); void condition_dump(Condition *c, FILE *f, const char *prefix, condition_to_string_t to_string); -void condition_dump_list(Condition *c, FILE *f, const char *prefix, condition_to_string_t to_string); +void condition_dump_list(Condition *first, FILE *f, const char *prefix, condition_to_string_t to_string); const char* condition_type_to_string(ConditionType t) _const_; ConditionType condition_type_from_string(const char *s) _pure_; diff --git a/src/shared/conf-parser.h b/src/shared/conf-parser.h index ecc432ec410..7cc00f3cf75 100644 --- a/src/shared/conf-parser.h +++ b/src/shared/conf-parser.h @@ -77,7 +77,7 @@ int config_parse_many( ConfigParseFlags flags, void *userdata, Hashmap **ret_stats_by_path, /* possibly NULL */ - char ***ret_drop_in_files); /* possibly NULL */ + char ***ret_dropin_files); /* possibly NULL */ int config_parse_standard_file_with_dropins_full( const char *root, diff --git a/src/shared/copy.h b/src/shared/copy.h index 118fb08a3a0..704abdb84b7 100644 --- a/src/shared/copy.h +++ b/src/shared/copy.h @@ -47,15 +47,15 @@ typedef enum DenyType { typedef int (*copy_progress_bytes_t)(uint64_t n_bytes, uint64_t bytes_per_second, void *userdata); typedef int (*copy_progress_path_t)(const char *path, const struct stat *st, void *userdata); -int copy_file_fd_at_full(int dir_fdf, const char *from, int to, CopyFlags copy_flags, copy_progress_bytes_t progress, void *userdata); -static inline int copy_file_fd_at(int dir_fdf, const char *from, int to, CopyFlags copy_flags, copy_progress_bytes_t progress, void *userdata) { - return copy_file_fd_at_full(dir_fdf, from, to, copy_flags, progress, userdata); +int copy_file_fd_at_full(int dir_fdf, const char *from, int fdt, CopyFlags copy_flags, copy_progress_bytes_t progress, void *userdata); +static inline int copy_file_fd_at(int dir_fdf, const char *from, int fdt, CopyFlags copy_flags, copy_progress_bytes_t progress, void *userdata) { + return copy_file_fd_at_full(dir_fdf, from, fdt, copy_flags, progress, userdata); } -static inline int copy_file_fd_full(const char *from, int to, CopyFlags copy_flags) { - return copy_file_fd_at_full(AT_FDCWD, from, to, copy_flags, NULL, NULL); +static inline int copy_file_fd_full(const char *from, int fdt, CopyFlags copy_flags) { + return copy_file_fd_at_full(AT_FDCWD, from, fdt, copy_flags, NULL, NULL); } -static inline int copy_file_fd(const char *from, int to, CopyFlags copy_flags) { - return copy_file_fd_at(AT_FDCWD, from, to, copy_flags, NULL, NULL); +static inline int copy_file_fd(const char *from, int fdt, CopyFlags copy_flags) { + return copy_file_fd_at(AT_FDCWD, from, fdt, copy_flags, NULL, NULL); } int copy_file_at_full(int dir_fdf, const char *from, int dir_fdt, const char *to, int open_flags, mode_t mode, unsigned chattr_flags, unsigned chattr_mask, CopyFlags copy_flags, copy_progress_bytes_t progress, void *userdata); diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index 01003e86b27..6bc6b66722b 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -4192,16 +4192,16 @@ finish: return r; } -Architecture dissected_image_architecture(DissectedImage *img) { - assert(img); +Architecture dissected_image_architecture(DissectedImage *m) { + assert(m); - if (img->partitions[PARTITION_ROOT].found && - img->partitions[PARTITION_ROOT].architecture >= 0) - return img->partitions[PARTITION_ROOT].architecture; + if (m->partitions[PARTITION_ROOT].found && + m->partitions[PARTITION_ROOT].architecture >= 0) + return m->partitions[PARTITION_ROOT].architecture; - if (img->partitions[PARTITION_USR].found && - img->partitions[PARTITION_USR].architecture >= 0) - return img->partitions[PARTITION_USR].architecture; + if (m->partitions[PARTITION_USR].found && + m->partitions[PARTITION_USR].architecture >= 0) + return m->partitions[PARTITION_USR].architecture; return _ARCHITECTURE_INVALID; } diff --git a/src/shared/dissect-image.h b/src/shared/dissect-image.h index 0e9732a923f..951ae660556 100644 --- a/src/shared/dissect-image.h +++ b/src/shared/dissect-image.h @@ -235,9 +235,20 @@ bool dissected_image_verity_candidate(const DissectedImage *image, PartitionDesi bool dissected_image_verity_ready(const DissectedImage *image, PartitionDesignator d); bool dissected_image_verity_sig_ready(const DissectedImage *image, PartitionDesignator d); -int mount_image_privately_interactively(const char *path, const ImagePolicy *image_policy, DissectImageFlags flags, char **ret_directory, int *ret_dir_fd, LoopDevice **ret_loop_device); - -int verity_dissect_and_mount(int src_fd, const char *src, const char *dest, const MountOptions *options, const ImagePolicy *image_policy, const ImageFilter *image_filter, const ExtensionReleaseData *required_release_data, ImageClass required_class, VeritySettings *verity, RuntimeScope runtime_scope, DissectedImage **ret_image); +int mount_image_privately_interactively(const char *image, const ImagePolicy *image_policy, DissectImageFlags flags, char **ret_directory, int *ret_dir_fd, LoopDevice **ret_loop_device); + +int verity_dissect_and_mount( + int src_fd, + const char *src, + const char *dest, + const MountOptions *options, + const ImagePolicy *image_policy, + const ImageFilter *image_filter, + const ExtensionReleaseData *extension_release_data, + ImageClass required_class, + VeritySettings *verity, + RuntimeScope runtime_scope, + DissectedImage **ret_image); int dissect_fstype_ok(const char *fstype); diff --git a/src/shared/dns-domain.c b/src/shared/dns-domain.c index d45fbc63438..c5805a593b0 100644 --- a/src/shared/dns-domain.c +++ b/src/shared/dns-domain.c @@ -756,12 +756,12 @@ int dns_name_reverse(int family, const union in_addr_union *a, char **ret) { return 0; } -int dns_name_address(const char *p, int *ret_family, union in_addr_union *ret_address) { +int dns_name_address(const char *p, int *ret_family, union in_addr_union *ret) { int r; assert(p); assert(ret_family); - assert(ret_address); + assert(ret); r = dns_name_endswith(p, "in-addr.arpa"); if (r < 0) @@ -790,7 +790,7 @@ int dns_name_address(const char *p, int *ret_family, union in_addr_union *ret_ad return r; *ret_family = AF_INET; - ret_address->in.s_addr = htobe32(((uint32_t) a[3] << 24) | + ret->in.s_addr = htobe32(((uint32_t) a[3] << 24) | ((uint32_t) a[2] << 16) | ((uint32_t) a[1] << 8) | (uint32_t) a[0]); @@ -834,12 +834,12 @@ int dns_name_address(const char *p, int *ret_family, union in_addr_union *ret_ad return r; *ret_family = AF_INET6; - ret_address->in6 = a; + ret->in6 = a; return 1; } *ret_family = AF_UNSPEC; - *ret_address = IN_ADDR_NULL; + *ret = IN_ADDR_NULL; return 0; } diff --git a/src/shared/dns-domain.h b/src/shared/dns-domain.h index c7730f70aa9..0491aa93704 100644 --- a/src/shared/dns-domain.h +++ b/src/shared/dns-domain.h @@ -10,7 +10,7 @@ typedef enum DNSLabelFlags { } DNSLabelFlags; int dns_label_unescape(const char **name, char *dest, size_t sz, DNSLabelFlags flags); -int dns_label_unescape_suffix(const char *name, const char **label_end, char *dest, size_t sz); +int dns_label_unescape_suffix(const char *name, const char **label_terminal, char *dest, size_t sz); int dns_label_escape(const char *p, size_t l, char *dest, size_t sz); int dns_label_escape_new(const char *p, size_t l, char **ret); @@ -51,7 +51,7 @@ static inline int dns_name_is_valid_ldh(const char *s) { return 1; } -void dns_name_hash_func(const char *s, struct siphash *state); +void dns_name_hash_func(const char *name, struct siphash *state); int dns_name_compare_func(const char *a, const char *b); extern const struct hash_ops dns_name_hash_ops; extern const struct hash_ops dns_name_hash_ops_free; @@ -64,7 +64,7 @@ int dns_name_startswith(const char *name, const char *prefix); int dns_name_change_suffix(const char *name, const char *old_suffix, const char *new_suffix, char **ret); int dns_name_reverse(int family, const union in_addr_union *a, char **ret); -int dns_name_address(const char *p, int *family, union in_addr_union *a); +int dns_name_address(const char *p, int *family, union in_addr_union *ret); bool dns_name_is_root(const char *name); bool dns_name_is_single_label(const char *name); diff --git a/src/shared/dns-packet.h b/src/shared/dns-packet.h index 58ff04d970a..bb413f1b962 100644 --- a/src/shared/dns-packet.h +++ b/src/shared/dns-packet.h @@ -148,8 +148,8 @@ static inline unsigned DNS_PACKET_RRCOUNT(DnsPacket *p) { (unsigned) DNS_PACKET_ARCOUNT(p); } -int dns_packet_new(DnsPacket **p, DnsProtocol protocol, size_t min_alloc_dsize, size_t max_size); -int dns_packet_new_query(DnsPacket **p, DnsProtocol protocol, size_t min_alloc_dsize, bool dnssec_checking_disabled); +int dns_packet_new(DnsPacket **ret, DnsProtocol protocol, size_t min_alloc_dsize, size_t max_size); +int dns_packet_new_query(DnsPacket **ret, DnsProtocol protocol, size_t min_alloc_dsize, bool dnssec_checking_disabled); int dns_packet_dup(DnsPacket **ret, DnsPacket *p); @@ -174,13 +174,13 @@ int dns_packet_validate_query(DnsPacket *p); int dns_packet_is_reply_for(DnsPacket *p, const DnsResourceKey *key); -int dns_packet_append_blob(DnsPacket *p, const void *d, size_t sz, size_t *start); +int dns_packet_append_blob(DnsPacket *p, const void *d, size_t l, size_t *start); int dns_packet_append_uint8(DnsPacket *p, uint8_t v, size_t *start); int dns_packet_append_uint16(DnsPacket *p, uint16_t v, size_t *start); int dns_packet_append_uint32(DnsPacket *p, uint32_t v, size_t *start); int dns_packet_append_string(DnsPacket *p, const char *s, size_t *start); int dns_packet_append_raw_string(DnsPacket *p, const void *s, size_t size, size_t *start); -int dns_packet_append_label(DnsPacket *p, const char *s, size_t l, bool canonical_candidate, size_t *start); +int dns_packet_append_label(DnsPacket *p, const char *d, size_t l, bool canonical_candidate, size_t *start); int dns_packet_append_name(DnsPacket *p, const char *name, bool allow_compression, bool canonical_candidate, size_t *start); int dns_packet_append_key(DnsPacket *p, const DnsResourceKey *key, DnsAnswerFlags flags, size_t *start); int dns_packet_append_rr(DnsPacket *p, const DnsResourceRecord *rr, DnsAnswerFlags flags, size_t *start, size_t *rdata_start); diff --git a/src/shared/dns-rr.h b/src/shared/dns-rr.h index 23752946e7f..56c30cf880e 100644 --- a/src/shared/dns-rr.h +++ b/src/shared/dns-rr.h @@ -407,12 +407,12 @@ bool dns_resource_record_is_link_local_address(DnsResourceRecord *rr); int dns_resource_record_get_cname_target(DnsResourceKey *key, DnsResourceRecord *cname, char **ret); -DnsTxtItem *dns_txt_item_free_all(DnsTxtItem *i); +DnsTxtItem *dns_txt_item_free_all(DnsTxtItem *first); bool dns_txt_item_equal(DnsTxtItem *a, DnsTxtItem *b); -DnsTxtItem *dns_txt_item_copy(DnsTxtItem *i); +DnsTxtItem *dns_txt_item_copy(DnsTxtItem *first); int dns_txt_item_new_empty(DnsTxtItem **ret); -DnsSvcParam *dns_svc_param_free_all(DnsSvcParam *i); +DnsSvcParam *dns_svc_param_free_all(DnsSvcParam *first); bool dns_svc_params_equal(DnsSvcParam *a, DnsSvcParam *b); DnsSvcParam *dns_svc_params_copy(DnsSvcParam *first); @@ -424,7 +424,7 @@ int dns_resource_record_to_json(DnsResourceRecord *rr, sd_json_variant **ret); void dns_resource_key_hash_func(const DnsResourceKey *k, struct siphash *state); int dns_resource_key_compare_func(const DnsResourceKey *x, const DnsResourceKey *y); -void dns_resource_record_hash_func(const DnsResourceRecord *i, struct siphash *state); +void dns_resource_record_hash_func(const DnsResourceRecord *rr, struct siphash *state); int dns_resource_record_compare_func(const DnsResourceRecord *x, const DnsResourceRecord *y); uint16_t dnssec_keytag(DnsResourceRecord *dnskey, bool mask_revoke); diff --git a/src/shared/dns-type.h b/src/shared/dns-type.h index 7c1dbf65d9c..2bb7a8b4482 100644 --- a/src/shared/dns-type.h +++ b/src/shared/dns-type.h @@ -147,7 +147,7 @@ const char* dns_type_to_string(int type); int dns_type_from_string(const char *s); const char* dns_class_to_string(uint16_t class); -int dns_class_from_string(const char *name); +int dns_class_from_string(const char *s); /* https://tools.ietf.org/html/draft-ietf-dane-protocol-23#section-7.2 */ const char* tlsa_cert_usage_to_string(uint8_t cert_usage); diff --git a/src/shared/dropin.h b/src/shared/dropin.h index c40a700e34f..635dbbf8bbd 100644 --- a/src/shared/dropin.h +++ b/src/shared/dropin.h @@ -32,4 +32,4 @@ int unit_file_find_dropin_paths( const char *file_suffix, const char *name, const Set *aliases, - char ***paths); + char ***ret); diff --git a/src/shared/efi-api.h b/src/shared/efi-api.h index 98c55f8a38f..0457416e6bb 100644 --- a/src/shared/efi-api.h +++ b/src/shared/efi-api.h @@ -11,7 +11,7 @@ int efi_reboot_to_firmware_supported(void); int efi_get_reboot_to_firmware(void); int efi_set_reboot_to_firmware(bool value); -int efi_get_boot_option(uint16_t nr, char **ret_title, sd_id128_t *ret_part_uuid, char **ret_path, bool *ret_active); +int efi_get_boot_option(uint16_t id, char **ret_title, sd_id128_t *ret_part_uuid, char **ret_path, bool *ret_active); int efi_add_boot_option(uint16_t id, const char *title, uint32_t part, uint64_t pstart, uint64_t psize, sd_id128_t part_uuid, const char *path); int efi_remove_boot_option(uint16_t id); int efi_get_boot_order(uint16_t **ret_order); diff --git a/src/shared/ethtool-util.h b/src/shared/ethtool-util.h index 84fbebdf1b9..2ce19f0eba7 100644 --- a/src/shared/ethtool-util.h +++ b/src/shared/ethtool-util.h @@ -173,12 +173,12 @@ int ethtool_set_eee_settings( uint32_t advertise); const char* duplex_to_string(Duplex d) _const_; -Duplex duplex_from_string(const char *d) _pure_; +Duplex duplex_from_string(const char *s) _pure_; int wol_options_to_string_alloc(uint32_t opts, char **ret); const char* port_to_string(NetDevPort port) _const_; -NetDevPort port_from_string(const char *port) _pure_; +NetDevPort port_from_string(const char *s) _pure_; const char* mdi_to_string(int mdi) _const_; diff --git a/src/shared/fork-notify.h b/src/shared/fork-notify.h index dd6ea9f15f6..103ab789833 100644 --- a/src/shared/fork-notify.h +++ b/src/shared/fork-notify.h @@ -3,7 +3,7 @@ #include "shared-forward.h" -int fork_notify(char * const *cmdline, PidRef *ret_pidref); +int fork_notify(char * const *argv, PidRef *ret_pidref); void fork_notify_terminate(PidRef *pidref); diff --git a/src/shared/format-table.c b/src/shared/format-table.c index 1c728a3d2bc..8d6e04f0fe1 100644 --- a/src/shared/format-table.c +++ b/src/shared/format-table.c @@ -457,7 +457,7 @@ static TableData *table_data_new( int table_add_cell_full( Table *t, TableCell **ret_cell, - TableDataType type, + TableDataType dt, const void *data, size_t minimum_width, size_t maximum_width, @@ -470,12 +470,12 @@ int table_add_cell_full( TableData *p; assert(t); - assert(type >= 0); - assert(type < _TABLE_DATA_TYPE_MAX); + assert(dt >= 0); + assert(dt < _TABLE_DATA_TYPE_MAX); /* Special rule: patch NULL data fields to the empty field */ if (!data) - type = TABLE_EMPTY; + dt = TABLE_EMPTY; /* Determine the cell adjacent to the current one, but one row up */ if (t->n_cells >= t->n_columns) @@ -499,15 +499,15 @@ int table_add_cell_full( assert(align_percent <= 100); assert(ellipsize_percent <= 100); - uppercase = type == TABLE_HEADER; + uppercase = dt == TABLE_HEADER; /* Small optimization: Pretty often adjacent cells in two subsequent lines have the same data and * formatting. Let's see if we can reuse the cell data and ref it once more. */ - if (p && table_data_matches(p, type, data, minimum_width, maximum_width, weight, align_percent, ellipsize_percent, uppercase)) + if (p && table_data_matches(p, dt, data, minimum_width, maximum_width, weight, align_percent, ellipsize_percent, uppercase)) d = table_data_ref(p); else { - d = table_data_new(type, data, minimum_width, maximum_width, weight, align_percent, ellipsize_percent, uppercase); + d = table_data_new(dt, data, minimum_width, maximum_width, weight, align_percent, ellipsize_percent, uppercase); if (!d) return -ENOMEM; } diff --git a/src/shared/format-table.h b/src/shared/format-table.h index b0b9b2060e4..2147b823178 100644 --- a/src/shared/format-table.h +++ b/src/shared/format-table.h @@ -99,11 +99,11 @@ Table *table_unref(Table *t); DEFINE_TRIVIAL_CLEANUP_FUNC(Table*, table_unref); -int table_add_cell_full(Table *t, TableCell **ret_cell, TableDataType type, const void *data, size_t minimum_width, size_t maximum_width, unsigned weight, unsigned align_percent, unsigned ellipsize_percent); -static inline int table_add_cell(Table *t, TableCell **ret_cell, TableDataType type, const void *data) { - return table_add_cell_full(t, ret_cell, type, data, SIZE_MAX, SIZE_MAX, UINT_MAX, UINT_MAX, UINT_MAX); +int table_add_cell_full(Table *t, TableCell **ret_cell, TableDataType dt, const void *data, size_t minimum_width, size_t maximum_width, unsigned weight, unsigned align_percent, unsigned ellipsize_percent); +static inline int table_add_cell(Table *t, TableCell **ret_cell, TableDataType dt, const void *data) { + return table_add_cell_full(t, ret_cell, dt, data, SIZE_MAX, SIZE_MAX, UINT_MAX, UINT_MAX, UINT_MAX); } -int table_add_cell_stringf_full(Table *t, TableCell **ret_cell, TableDataType type, const char *format, ...) _printf_(4, 5); +int table_add_cell_stringf_full(Table *t, TableCell **ret_cell, TableDataType dt, const char *format, ...) _printf_(4, 5); #define table_add_cell_stringf(t, ret_cell, format, ...) table_add_cell_stringf_full(t, ret_cell, TABLE_STRING, format, __VA_ARGS__) int table_fill_empty(Table *t, size_t until_column); diff --git a/src/shared/generator.c b/src/shared/generator.c index 095e52e1944..10187760030 100644 --- a/src/shared/generator.c +++ b/src/shared/generator.c @@ -36,7 +36,7 @@ static int symlink_unless_exists(const char *target, const char *linkpath) { int generator_open_unit_file_full( const char *dir, const char *source, - const char *fn, + const char *filename, FILE **ret_file, char **ret_final_path, char **ret_temp_path) { @@ -60,9 +60,9 @@ int generator_open_unit_file_full( *ret_temp_path = TAKE_PTR(p); } else { - assert(fn); + assert(filename); - p = path_join(dir, fn); + p = path_join(dir, filename); if (!p) return log_oom(); diff --git a/src/shared/generator.h b/src/shared/generator.h index 81ab190c1fb..fb627d4e7af 100644 --- a/src/shared/generator.h +++ b/src/shared/generator.h @@ -4,9 +4,9 @@ #include "shared-forward.h" #include "main-func.h" -int generator_open_unit_file_full(const char *dest, const char *source, const char *name, FILE **ret_file, char **ret_final_path, char **ret_temp_path); -static inline int generator_open_unit_file(const char *dest, const char *source, const char *name, FILE **ret_file) { - return generator_open_unit_file_full(dest, source, name, ret_file, NULL, NULL); +int generator_open_unit_file_full(const char *dir, const char *source, const char *filename, FILE **ret_file, char **ret_final_path, char **ret_temp_path); +static inline int generator_open_unit_file(const char *dir, const char *source, const char *filename, FILE **ret_file) { + return generator_open_unit_file_full(dir, source, filename, ret_file, NULL, NULL); } int generator_add_symlink_full(const char *dir, const char *dst, const char *dep_type, const char *src, const char *instance); diff --git a/src/shared/geneve-util.h b/src/shared/geneve-util.h index b5a4930443f..5d6ee87ea14 100644 --- a/src/shared/geneve-util.h +++ b/src/shared/geneve-util.h @@ -14,4 +14,4 @@ typedef enum GeneveDF { } GeneveDF; const char* geneve_df_to_string(GeneveDF d) _const_; -GeneveDF geneve_df_from_string(const char *d) _pure_; +GeneveDF geneve_df_from_string(const char *s) _pure_; diff --git a/src/shared/gpt.h b/src/shared/gpt.h index e8a3c5eece1..7a977ac7beb 100644 --- a/src/shared/gpt.h +++ b/src/shared/gpt.h @@ -50,7 +50,7 @@ static inline bool partition_designator_is_verity(PartitionDesignator d) { } const char* partition_designator_to_string(PartitionDesignator d) _const_; -PartitionDesignator partition_designator_from_string(const char *name) _pure_; +PartitionDesignator partition_designator_from_string(const char *s) _pure_; const char* partition_mountpoint_to_string(PartitionDesignator d) _const_; diff --git a/src/shared/group-record.h b/src/shared/group-record.h index 730938c3d92..ba7ee01da6f 100644 --- a/src/shared/group-record.h +++ b/src/shared/group-record.h @@ -43,7 +43,7 @@ int group_record_load(GroupRecord *h, sd_json_variant *v, UserRecordLoadFlags fl int group_record_build(GroupRecord **ret, ...); #define group_record_buildo(ret, ...) \ group_record_build((ret), SD_JSON_BUILD_OBJECT(__VA_ARGS__)) -int group_record_clone(GroupRecord *g, UserRecordLoadFlags flags, GroupRecord **ret); +int group_record_clone(GroupRecord *h, UserRecordLoadFlags flags, GroupRecord **ret); bool group_record_match(GroupRecord *h, const UserDBMatch *match); diff --git a/src/shared/import-util.c b/src/shared/import-util.c index 9c9a9d7e301..2644f59fda1 100644 --- a/src/shared/import-util.c +++ b/src/shared/import-util.c @@ -166,7 +166,7 @@ int tar_strip_suffixes(const char *name, char **ret) { return 0; } -int raw_strip_suffixes(const char *p, char **ret) { +int raw_strip_suffixes(const char *name, char **ret) { static const char suffixes[] = ".xz\0" @@ -182,7 +182,7 @@ int raw_strip_suffixes(const char *p, char **ret) { _cleanup_free_ char *q = NULL; - q = strdup(p); + q = strdup(name); if (!q) return -ENOMEM; diff --git a/src/shared/install.h b/src/shared/install.h index 1d0b93d05cd..53753a0366b 100644 --- a/src/shared/install.h +++ b/src/shared/install.h @@ -100,7 +100,7 @@ int unit_file_disable( RuntimeScope scope, UnitFileFlags flags, const char *root_dir, - char * const *names, + char * const *files, InstallChange **changes, size_t *n_changes); int unit_file_reenable( @@ -175,15 +175,15 @@ int unit_file_add_dependency( int unit_file_lookup_state( RuntimeScope scope, - const LookupPaths *paths, + const LookupPaths *lp, const char *name, UnitFileState *ret); int unit_file_get_state(RuntimeScope scope, const char *root_dir, const char *filename, UnitFileState *ret); -int unit_file_exists_full(RuntimeScope scope, const LookupPaths *paths, const char *name, char **ret_path); -static inline int unit_file_exists(RuntimeScope scope, const LookupPaths *paths, const char *name) { - return unit_file_exists_full(scope, paths, name, NULL); +int unit_file_exists_full(RuntimeScope scope, const LookupPaths *lp, const char *name, char **ret_path); +static inline int unit_file_exists(RuntimeScope scope, const LookupPaths *lp, const char *name) { + return unit_file_exists_full(scope, lp, name, NULL); } int unit_file_get_list(RuntimeScope scope, const char *root_dir, char * const *states, char * const *patterns, Hashmap **ret); diff --git a/src/shared/ioprio-util.h b/src/shared/ioprio-util.h index 04d44c77005..e50110729be 100644 --- a/src/shared/ioprio-util.h +++ b/src/shared/ioprio-util.h @@ -17,7 +17,7 @@ static inline int ioprio_prio_value(int class, int data) { return IOPRIO_PRIO_VALUE_HINT(class, IOPRIO_PRIO_LEVEL(data), IOPRIO_PRIO_HINT(data)); } -int ioprio_class_to_string_alloc(int i, char **s); +int ioprio_class_to_string_alloc(int i, char **ret); int ioprio_class_from_string(const char *s); static inline bool ioprio_class_is_valid(int i) { diff --git a/src/shared/ipvlan-util.h b/src/shared/ipvlan-util.h index fdfcb759ecd..cf7f89da39c 100644 --- a/src/shared/ipvlan-util.h +++ b/src/shared/ipvlan-util.h @@ -22,7 +22,7 @@ typedef enum IPVlanFlags { } IPVlanFlags; const char* ipvlan_mode_to_string(IPVlanMode d) _const_; -IPVlanMode ipvlan_mode_from_string(const char *d) _pure_; +IPVlanMode ipvlan_mode_from_string(const char *s) _pure_; const char* ipvlan_flags_to_string(IPVlanFlags d) _const_; -IPVlanFlags ipvlan_flags_from_string(const char *d) _pure_; +IPVlanFlags ipvlan_flags_from_string(const char *s) _pure_; diff --git a/src/shared/local-addresses.h b/src/shared/local-addresses.h index 089239dac66..6dd1b30051c 100644 --- a/src/shared/local-addresses.h +++ b/src/shared/local-addresses.h @@ -18,8 +18,8 @@ bool has_local_address(const struct local_address *addresses, size_t n_addresses int add_local_address(struct local_address **list, size_t *n_list, int ifindex, unsigned char scope, int family, const union in_addr_union *address); -int local_addresses(sd_netlink *rtnl, int ifindex, int af, struct local_address **ret); +int local_addresses(sd_netlink *context, int ifindex, int af, struct local_address **ret); -int local_gateways(sd_netlink *rtnl, int ifindex, int af, struct local_address **ret); +int local_gateways(sd_netlink *context, int ifindex, int af, struct local_address **ret); -int local_outbounds(sd_netlink *rtnl, int ifindex, int af, struct local_address **ret); +int local_outbounds(sd_netlink *context, int ifindex, int af, struct local_address **ret); diff --git a/src/shared/macvlan-util.h b/src/shared/macvlan-util.h index 78817d2ce66..5eccd630492 100644 --- a/src/shared/macvlan-util.h +++ b/src/shared/macvlan-util.h @@ -16,4 +16,4 @@ typedef enum MacVlanMode { } MacVlanMode; const char* macvlan_mode_to_string(MacVlanMode d) _const_; -MacVlanMode macvlan_mode_from_string(const char *d) _pure_; +MacVlanMode macvlan_mode_from_string(const char *s) _pure_; diff --git a/src/shared/mount-util.h b/src/shared/mount-util.h index c607875375f..0fedbe44f4c 100644 --- a/src/shared/mount-util.h +++ b/src/shared/mount-util.h @@ -17,9 +17,9 @@ int bind_mount_submounts( int repeat_unmount(const char *path, int flags); -int umount_recursive_full(const char *target, int flags, char **keep); -static inline int umount_recursive(const char *target, int flags) { - return umount_recursive_full(target, flags, NULL); +int umount_recursive_full(const char *prefix, int flags, char **keep); +static inline int umount_recursive(const char *prefix, int flags) { + return umount_recursive_full(prefix, flags, NULL); } int bind_remount_recursive_with_mountinfo(const char *prefix, unsigned long new_flags, unsigned long flags_mask, char **deny_list, FILE *proc_self_mountinfo); @@ -80,7 +80,7 @@ int mount_option_mangle( unsigned long *ret_mount_flags, char **ret_remaining_options); -int mode_to_inaccessible_node(const char *runtime_dir, mode_t mode, char **dest); +int mode_to_inaccessible_node(const char *runtime_dir, mode_t mode, char **ret); int mount_flags_to_string(unsigned long flags, char **ret); /* Useful for usage with _cleanup_(), unmounts, removes a directory and frees the pointer */ @@ -148,9 +148,15 @@ typedef enum RemountIdmapping { int open_tree_attr_with_fallback(int dir_fd, const char *path, unsigned flags, struct mount_attr *attr); int open_tree_try_drop_idmap(int dir_fd, const char *path, unsigned flags); -int make_userns(uid_t uid_shift, uid_t uid_range, uid_t host_owner, uid_t dest_owner, RemountIdmapping idmapping); +int make_userns(uid_t uid_shift, uid_t uid_range, uid_t source_owner, uid_t dest_owner, RemountIdmapping idmapping); int remount_idmap_fd(char **p, int userns_fd, uint64_t extra_mount_attr_set); -int remount_idmap(char **p, uid_t uid_shift, uid_t uid_range, uid_t host_owner, uid_t dest_owner, RemountIdmapping idmapping); +int remount_idmap( + char **p, + uid_t uid_shift, + uid_t uid_range, + uid_t source_owner, + uid_t dest_owner, + RemountIdmapping idmapping); /* Creates a mount point (without any parents) based on the source path or mode - i.e., a file or a directory */ int make_mount_point_inode_from_mode(int dir_fd, const char *dest, mode_t source_mode, mode_t target_mode); diff --git a/src/shared/netif-naming-scheme.h b/src/shared/netif-naming-scheme.h index 0929f7ce633..8448c4e9572 100644 --- a/src/shared/netif-naming-scheme.h +++ b/src/shared/netif-naming-scheme.h @@ -96,10 +96,10 @@ typedef enum NamePolicy { } NamePolicy; const char* name_policy_to_string(NamePolicy p) _const_; -NamePolicy name_policy_from_string(const char *p) _pure_; +NamePolicy name_policy_from_string(const char *s) _pure_; const char* alternative_names_policy_to_string(NamePolicy p) _const_; -NamePolicy alternative_names_policy_from_string(const char *p) _pure_; +NamePolicy alternative_names_policy_from_string(const char *s) _pure_; int device_get_sysattr_int_filtered(sd_device *device, const char *sysattr, int *ret_value); int device_get_sysattr_unsigned_filtered(sd_device *device, const char *sysattr, unsigned *ret_value); diff --git a/src/shared/numa-util.h b/src/shared/numa-util.h index 6e31c00f041..2966aa08db0 100644 --- a/src/shared/numa-util.h +++ b/src/shared/numa-util.h @@ -29,7 +29,7 @@ static inline void numa_policy_reset(NUMAPolicy *p) { } int apply_numa_policy(const NUMAPolicy *policy); -int numa_to_cpu_set(const NUMAPolicy *policy, CPUSet *set); +int numa_to_cpu_set(const NUMAPolicy *policy, CPUSet *ret); int numa_mask_add_all(CPUSet *mask); diff --git a/src/shared/open-file.h b/src/shared/open-file.h index d11cf471de4..0d1acaa0e29 100644 --- a/src/shared/open-file.h +++ b/src/shared/open-file.h @@ -35,4 +35,4 @@ static inline void open_file_free_many(OpenFile **head) { } const char* open_file_flags_to_string(OpenFileFlag t) _const_; -OpenFileFlag open_file_flags_from_string(const char *t) _pure_; +OpenFileFlag open_file_flags_from_string(const char *s) _pure_; diff --git a/src/shared/pager.h b/src/shared/pager.h index 3760cd702c6..2de516717d3 100644 --- a/src/shared/pager.h +++ b/src/shared/pager.h @@ -12,4 +12,4 @@ void pager_open(PagerFlags flags); void pager_close(void); bool pager_have(void) _pure_; -int show_man_page(const char *page, bool null_stdio); +int show_man_page(const char *desc, bool null_stdio); diff --git a/src/shared/pam-util.h b/src/shared/pam-util.h index 85f91255637..15204eb9394 100644 --- a/src/shared/pam-util.h +++ b/src/shared/pam-util.h @@ -73,7 +73,12 @@ void pam_bus_data_disconnectp(PamBusData **d); /* Use a different module name per different PAM module. They are all loaded in the same namespace, and this * helps avoid a clash in the internal data structures of sd-bus. It will be used as key for cache items. */ -int pam_acquire_bus_connection(pam_handle_t *handle, const char *module_name, bool debug, sd_bus **ret_bus, PamBusData **ret_bus_data); +int pam_acquire_bus_connection( + pam_handle_t *handle, + const char *module_name, + bool debug, + sd_bus **ret_bus, + PamBusData **ret_pam_bus_data); int pam_get_bus_data(pam_handle_t *handle, const char *module_name, PamBusData **ret); void pam_cleanup_free(pam_handle_t *handle, void *data, int error_status); diff --git a/src/shared/pkcs11-util.c b/src/shared/pkcs11-util.c index 1b8051a1abc..2111e4b966c 100644 --- a/src/shared/pkcs11-util.c +++ b/src/shared/pkcs11-util.c @@ -265,11 +265,11 @@ int pkcs11_token_login( CK_SLOT_ID slotid, const CK_TOKEN_INFO *token_info, const char *friendly_name, - const char *askpw_icon, - const char *askpw_keyring, - const char *askpw_credential, + const char *ask_password_icon, + const char *ask_password_keyring, + const char *ask_password_credential, usec_t until, - AskPasswordFlags askpw_flags, + AskPasswordFlags ask_password_flags, char **ret_used_pin) { _cleanup_free_ char *token_uri_string = NULL, *token_uri_escaped = NULL, *id = NULL, *token_label = NULL; @@ -324,7 +324,7 @@ int pkcs11_token_login( if (!passwords) return log_oom(); - } else if (FLAGS_SET(askpw_flags, ASK_PASSWORD_HEADLESS)) + } else if (FLAGS_SET(ask_password_flags, ASK_PASSWORD_HEADLESS)) return log_error_errno(SYNTHETIC_ERRNO(ENOPKG), "PIN querying disabled via 'headless' option. Use the 'PIN' environment variable."); else { _cleanup_free_ char *text = NULL; @@ -351,16 +351,16 @@ int pkcs11_token_login( AskPasswordRequest req = { .tty_fd = -EBADF, .message = text, - .icon = askpw_icon, + .icon = ask_password_icon, .id = id, - .keyring = askpw_keyring, - .credential = askpw_credential, + .keyring = ask_password_keyring, + .credential = ask_password_credential, .until = until, .hup_fd = -EBADF, }; /* We never cache PINs, simply because it's fatal if we use wrong PINs, since usually there are only 3 tries */ - r = ask_password_auto(&req, askpw_flags, &passwords); + r = ask_password_auto(&req, ask_password_flags, &passwords); if (r < 0) return log_error_errno(r, "Failed to query PIN for security token '%s': %m", token_label); } diff --git a/src/shared/pkcs11-util.h b/src/shared/pkcs11-util.h index 6f04245479e..51279eabc47 100644 --- a/src/shared/pkcs11-util.h +++ b/src/shared/pkcs11-util.h @@ -50,7 +50,18 @@ char* pkcs11_token_manufacturer_id(const CK_TOKEN_INFO *token_info); char* pkcs11_token_model(const CK_TOKEN_INFO *token_info); int pkcs11_token_login_by_pin(CK_FUNCTION_LIST *m, CK_SESSION_HANDLE session, const CK_TOKEN_INFO *token_info, const char *token_label, const void *pin, size_t pin_size); -int pkcs11_token_login(CK_FUNCTION_LIST *m, CK_SESSION_HANDLE session, CK_SLOT_ID slotid, const CK_TOKEN_INFO *token_info, const char *friendly_name, const char *icon_name, const char *key_name, const char *credential_name, usec_t until, AskPasswordFlags ask_password_flags, char **ret_used_pin); +int pkcs11_token_login( + CK_FUNCTION_LIST *m, + CK_SESSION_HANDLE session, + CK_SLOT_ID slotid, + const CK_TOKEN_INFO *token_info, + const char *friendly_name, + const char *ask_password_icon, + const char *ask_password_key, + const char *ask_password_credential, + usec_t until, + AskPasswordFlags ask_password_flags, + char **ret_used_pin); int pkcs11_token_find_related_object(CK_FUNCTION_LIST *m, CK_SESSION_HANDLE session, CK_OBJECT_HANDLE prototype, CK_OBJECT_CLASS class, CK_OBJECT_HANDLE *ret_object); #if HAVE_OPENSSL diff --git a/src/shared/ptyfwd.h b/src/shared/ptyfwd.h index 31020952d33..1c1246f37f1 100644 --- a/src/shared/ptyfwd.h +++ b/src/shared/ptyfwd.h @@ -31,8 +31,8 @@ PTYForward* pty_forward_free(PTYForward *f); int pty_forward_honor_vhangup(PTYForward *f); bool pty_forward_vhangup_honored(const PTYForward *f); -void pty_forward_set_hangup_handler(PTYForward *f, PTYForwardHangupHandler handler, void *userdata); -void pty_forward_set_hotkey_handler(PTYForward *f, PTYForwardHotkeyHandler handler, void *userdata); +void pty_forward_set_hangup_handler(PTYForward *f, PTYForwardHangupHandler cb, void *userdata); +void pty_forward_set_hotkey_handler(PTYForward *f, PTYForwardHotkeyHandler cb, void *userdata); int pty_forward_drain(PTYForward *f); diff --git a/src/shared/resize-fs.h b/src/shared/resize-fs.h index 6f2cc0219e0..57877ed13c6 100644 --- a/src/shared/resize-fs.h +++ b/src/shared/resize-fs.h @@ -11,6 +11,6 @@ int resize_fs(int fd, uint64_t sz, uint64_t *ret_size); #define EXT4_MINIMAL_SIZE (32U*U64_MB) uint64_t minimal_size_by_fs_magic(statfs_f_type_t magic); -uint64_t minimal_size_by_fs_name(const char *str); +uint64_t minimal_size_by_fs_name(const char *name); bool fs_can_online_shrink_and_grow(statfs_f_type_t magic); diff --git a/src/shared/seccomp-util.h b/src/shared/seccomp-util.h index e853b9e225c..84ba1a2f8a1 100644 --- a/src/shared/seccomp-util.h +++ b/src/shared/seccomp-util.h @@ -84,7 +84,7 @@ int seccomp_filter_set_add_by_name(Hashmap *filter, bool add, const char *name); int seccomp_filter_set_add(Hashmap *filter, bool add, const SyscallFilterSet *set); int seccomp_add_syscall_filter_item( - scmp_filter_ctx *ctx, + scmp_filter_ctx *seccomp, const char *name, uint32_t action, char **exclude, diff --git a/src/shared/selinux-util.h b/src/shared/selinux-util.h index e6432b37922..ab499e8c4ff 100644 --- a/src/shared/selinux-util.h +++ b/src/shared/selinux-util.h @@ -101,7 +101,7 @@ int mac_selinux_get_our_label(char **ret_label); int mac_selinux_get_peer_label(int socket_fd, char **ret_label); int mac_selinux_get_child_mls_label(int socket_fd, const char *exe, const char *exec_label, char **ret_label); -int mac_selinux_create_file_prepare_at(int dirfd, const char *path, mode_t mode); +int mac_selinux_create_file_prepare_at(int dir_fd, const char *path, mode_t mode); static inline int mac_selinux_create_file_prepare(const char *path, mode_t mode) { return mac_selinux_create_file_prepare_at(AT_FDCWD, path, mode); } diff --git a/src/shared/serialize.c b/src/shared/serialize.c index f7d60ac0b75..8aa64773000 100644 --- a/src/shared/serialize.c +++ b/src/shared/serialize.c @@ -162,15 +162,15 @@ int serialize_usec(FILE *f, const char *key, usec_t usec) { return serialize_item_format(f, key, USEC_FMT, usec); } -int serialize_dual_timestamp(FILE *f, const char *name, const dual_timestamp *t) { +int serialize_dual_timestamp(FILE *f, const char *key, const dual_timestamp *t) { assert(f); - assert(name); + assert(key); assert(t); if (!dual_timestamp_is_set(t)) return 0; - return serialize_item_format(f, name, USEC_FMT " " USEC_FMT, t->realtime, t->monotonic); + return serialize_item_format(f, key, USEC_FMT " " USEC_FMT, t->realtime, t->monotonic); } int serialize_strv(FILE *f, const char *key, char * const *l) { diff --git a/src/shared/serialize.h b/src/shared/serialize.h index 6e5e9216ba3..57607670fbc 100644 --- a/src/shared/serialize.h +++ b/src/shared/serialize.h @@ -5,7 +5,7 @@ int serialize_item(FILE *f, const char *key, const char *value); int serialize_item_escaped(FILE *f, const char *key, const char *value); -int serialize_item_format(FILE *f, const char *key, const char *value, ...) _printf_(3,4); +int serialize_item_format(FILE *f, const char *key, const char *format, ...) _printf_(3,4); int serialize_item_hexmem(FILE *f, const char *key, const void *p, size_t l); int serialize_item_base64mem(FILE *f, const char *key, const void *p, size_t l); int serialize_fd(FILE *f, FDSet *fds, const char *key, int fd); @@ -31,7 +31,7 @@ int deserialize_fd(FDSet *fds, const char *value); int deserialize_fd_many(FDSet *fds, const char *value, size_t n, int *ret); int deserialize_usec(const char *value, usec_t *ret); int deserialize_dual_timestamp(const char *value, dual_timestamp *ret); -int deserialize_environment(const char *value, char ***environment); +int deserialize_environment(const char *value, char ***list); int deserialize_strv(const char *value, char ***l); int deserialize_pidref(FDSet *fds, const char *value, PidRef *ret); void deserialize_ratelimit(RateLimit *rl, const char *name, const char *value); diff --git a/src/shared/sleep-config.h b/src/shared/sleep-config.h index 129c9e6b474..984a1c53dd2 100644 --- a/src/shared/sleep-config.h +++ b/src/shared/sleep-config.h @@ -39,7 +39,7 @@ typedef struct SleepConfig { SleepConfig* sleep_config_free(SleepConfig *sc); DEFINE_TRIVIAL_CLEANUP_FUNC(SleepConfig*, sleep_config_free); -int parse_sleep_config(SleepConfig **sleep_config); +int parse_sleep_config(SleepConfig **ret); bool sleep_needs_mem_sleep(const SleepConfig *sc, SleepOperation operation) _pure_; diff --git a/src/shared/socket-label.c b/src/shared/socket-label.c index e16f9537a67..3f2ac99b9b0 100644 --- a/src/shared/socket-label.c +++ b/src/shared/socket-label.c @@ -24,16 +24,16 @@ static const char* const socket_address_bind_ipv6_only_table[_SOCKET_ADDRESS_BIN DEFINE_STRING_TABLE_LOOKUP(socket_address_bind_ipv6_only, SocketAddressBindIPv6Only); -SocketAddressBindIPv6Only socket_address_bind_ipv6_only_or_bool_from_string(const char *n) { +SocketAddressBindIPv6Only socket_address_bind_ipv6_only_or_bool_from_string(const char *s) { int r; - r = parse_boolean(n); + r = parse_boolean(s); if (r > 0) return SOCKET_ADDRESS_IPV6_ONLY; if (r == 0) return SOCKET_ADDRESS_BOTH; - return socket_address_bind_ipv6_only_from_string(n); + return socket_address_bind_ipv6_only_from_string(s); } int socket_address_listen( diff --git a/src/shared/tests.h b/src/shared/tests.h index 885460d6fe7..82c186b32b7 100644 --- a/src/shared/tests.h +++ b/src/shared/tests.h @@ -596,7 +596,7 @@ enum { ASSERT_SIGNAL_FORK_PARENT = 1, /* We are in the parent process */ }; -int assert_signal_internal(int *ret_status); +int assert_signal_internal(int *ret_signal); #ifdef __COVERITY__ # define ASSERT_SIGNAL(expr, signal) __coverity_check__(((expr), false)) diff --git a/src/shared/tpm2-util.c b/src/shared/tpm2-util.c index 789295b6896..10a5b3d564a 100644 --- a/src/shared/tpm2-util.c +++ b/src/shared/tpm2-util.c @@ -9145,7 +9145,7 @@ int tpm2_util_pbkdf2_hmac_sha256(const void *pass, size_t passlen, const void *salt, size_t saltlen, - uint8_t ret_key[static SHA256_DIGEST_SIZE]) { + uint8_t ret[static SHA256_DIGEST_SIZE]) { _cleanup_(erase_and_freep) uint8_t *buffer = NULL; uint8_t u[SHA256_DIGEST_SIZE]; @@ -9176,8 +9176,8 @@ int tpm2_util_pbkdf2_hmac_sha256(const void *pass, hmac_sha256(pass, passlen, buffer, saltlen + sizeof(block_cnt), u); /* dk needs to be an unmodified u as u gets modified in the loop */ - memcpy(ret_key, u, SHA256_DIGEST_SIZE); - uint8_t *dk = ret_key; + memcpy(ret, u, SHA256_DIGEST_SIZE); + uint8_t *dk = ret; for (size_t i = 1; i < PBKDF2_HMAC_SHA256_ITERATIONS; i++) { hmac_sha256(pass, passlen, u, sizeof(u), u); diff --git a/src/shared/tpm2-util.h b/src/shared/tpm2-util.h index 59b7ed9984f..b46bec03363 100644 --- a/src/shared/tpm2-util.h +++ b/src/shared/tpm2-util.h @@ -184,11 +184,11 @@ char* tpm2_tpml_pcr_selection_to_string(const TPML_PCR_SELECTION *l); size_t tpm2_tpml_pcr_selection_weight(const TPML_PCR_SELECTION *l); #define tpm2_tpml_pcr_selection_is_empty(l) (tpm2_tpml_pcr_selection_weight(l) == 0) -int tpm2_digest_many(TPMI_ALG_HASH alg, TPM2B_DIGEST *digest, const struct iovec data[], size_t count, bool extend); +int tpm2_digest_many(TPMI_ALG_HASH alg, TPM2B_DIGEST *digest, const struct iovec data[], size_t n_data, bool extend); static inline int tpm2_digest_buffer(TPMI_ALG_HASH alg, TPM2B_DIGEST *digest, const void *data, size_t len, bool extend) { return tpm2_digest_many(alg, digest, &IOVEC_MAKE((void*) data, len), 1, extend); } -int tpm2_digest_many_digests(TPMI_ALG_HASH alg, TPM2B_DIGEST *digest, const TPM2B_DIGEST data[], size_t count, bool extend); +int tpm2_digest_many_digests(TPMI_ALG_HASH alg, TPM2B_DIGEST *digest, const TPM2B_DIGEST data[], size_t n_data, bool extend); static inline int tpm2_digest_rehash(TPMI_ALG_HASH alg, TPM2B_DIGEST *digest) { return tpm2_digest_many(alg, digest, NULL, 0, true); } @@ -501,7 +501,7 @@ int tpm2_util_pbkdf2_hmac_sha256(const void *pass, size_t passlen, const void *salt, size_t saltlen, - uint8_t res[static SHA256_DIGEST_SIZE]); + uint8_t ret[static SHA256_DIGEST_SIZE]); enum { /* Additional defines for the PCR index naming enum from "fundamental/tpm2-pcr.h" */ diff --git a/src/shared/udev-util.h b/src/shared/udev-util.h index 6076f328f4c..1701c50279b 100644 --- a/src/shared/udev-util.h +++ b/src/shared/udev-util.h @@ -8,7 +8,7 @@ int udev_parse_config_full(const ConfigTableItem config_table[]); int udev_parse_config(void); int device_wait_for_initialization(sd_device *device, const char *subsystem, usec_t timeout_usec, sd_device **ret); -int device_wait_for_devlink(const char *path, const char *subsystem, usec_t timeout_usec, sd_device **ret); +int device_wait_for_devlink(const char *devlink, const char *subsystem, usec_t timeout_usec, sd_device **ret); int device_is_renaming(sd_device *dev); int device_is_processed(sd_device *dev); diff --git a/src/shared/unit-file.h b/src/shared/unit-file.h index dd1cd33fdaf..6434bf58b99 100644 --- a/src/shared/unit-file.h +++ b/src/shared/unit-file.h @@ -77,4 +77,4 @@ int unit_file_find_fragment( const char **ret_fragment_path, Set **ret_names); -const char* runlevel_to_target(const char *rl); +const char* runlevel_to_target(const char *word); diff --git a/src/shared/user-record.h b/src/shared/user-record.h index d0d95473eb0..34d08005767 100644 --- a/src/shared/user-record.h +++ b/src/shared/user-record.h @@ -469,7 +469,7 @@ uint32_t user_record_dev_shm_limit_scale(UserRecord *h); const char **user_record_self_modifiable_fields(UserRecord *h); const char **user_record_self_modifiable_blobs(UserRecord *h); const char **user_record_self_modifiable_privileged(UserRecord *h); -int user_record_self_changes_allowed(UserRecord *current, UserRecord *new); +int user_record_self_changes_allowed(UserRecord *current, UserRecord *incoming); int user_record_build_image_path(UserStorage storage, const char *user_name_and_realm, char **ret); diff --git a/src/shared/vconsole-util.h b/src/shared/vconsole-util.h index 13aca45204f..494bc6ea489 100644 --- a/src/shared/vconsole-util.h +++ b/src/shared/vconsole-util.h @@ -39,4 +39,4 @@ typedef int (*X11VerifyCallback)(const X11Context *xc); int vconsole_convert_to_x11(const VCContext *vc, X11VerifyCallback verify, X11Context *ret); int x11_convert_to_vconsole(const X11Context *xc, VCContext *ret); -int vconsole_serialize(const VCContext *vc, const X11Context *xc, char ***ret); +int vconsole_serialize(const VCContext *vc, const X11Context *xc, char ***env); diff --git a/src/shared/watchdog.h b/src/shared/watchdog.h index 322614247b6..61f60b949d8 100644 --- a/src/shared/watchdog.h +++ b/src/shared/watchdog.h @@ -9,7 +9,7 @@ dual_timestamp* watchdog_get_last_ping_as_dual_timestamp(dual_timestamp *ret); int watchdog_set_device(const char *path); int watchdog_setup(usec_t timeout); -int watchdog_setup_pretimeout(usec_t usec); +int watchdog_setup_pretimeout(usec_t timeout); int watchdog_setup_pretimeout_governor(const char *governor); int watchdog_ping(void); void watchdog_report_if_missing(void); diff --git a/src/systemd/sd-bus.h b/src/systemd/sd-bus.h index a89e9842d8a..b939ef1d0d7 100644 --- a/src/systemd/sd-bus.h +++ b/src/systemd/sd-bus.h @@ -57,10 +57,10 @@ int sd_bus_new(sd_bus **ret); int sd_bus_set_address(sd_bus *bus, const char *address); int sd_bus_set_fd(sd_bus *bus, int input_fd, int output_fd); int sd_bus_set_exec(sd_bus *bus, const char *path, char *const *argv); -int sd_bus_get_address(sd_bus *bus, const char **address); +int sd_bus_get_address(sd_bus *bus, const char **ret); int sd_bus_set_bus_client(sd_bus *bus, int b); int sd_bus_is_bus_client(sd_bus *bus); -int sd_bus_set_server(sd_bus *bus, int b, sd_id128_t bus_id); +int sd_bus_set_server(sd_bus *bus, int b, sd_id128_t server_id); int sd_bus_is_server(sd_bus *bus); int sd_bus_set_anonymous(sd_bus *bus, int b); int sd_bus_is_anonymous(sd_bus *bus); @@ -439,8 +439,8 @@ const char* sd_bus_track_contains(sd_bus_track *track, const char *name); const char* sd_bus_track_first(sd_bus_track *track); const char* sd_bus_track_next(sd_bus_track *track); -int sd_bus_track_set_destroy_callback(sd_bus_track *s, sd_bus_destroy_t callback); -int sd_bus_track_get_destroy_callback(sd_bus_track *s, sd_bus_destroy_t *ret); +int sd_bus_track_set_destroy_callback(sd_bus_track *track, sd_bus_destroy_t callback); +int sd_bus_track_get_destroy_callback(sd_bus_track *track, sd_bus_destroy_t *ret); /* Define helpers so that __attribute__((cleanup(sd_bus_unrefp))) and similar may be used. */ _SD_DEFINE_POINTER_CLEANUP_FUNC(sd_bus, sd_bus_unref); diff --git a/src/systemd/sd-device.h b/src/systemd/sd-device.h index 92381b2119e..3a40c209927 100644 --- a/src/systemd/sd-device.h +++ b/src/systemd/sd-device.h @@ -65,8 +65,8 @@ int sd_device_new_from_ifindex(sd_device **ret, int ifindex); int sd_device_new_child(sd_device **ret, sd_device *device, const char *suffix); -int sd_device_get_parent(sd_device *child, sd_device **ret); -int sd_device_get_parent_with_subsystem_devtype(sd_device *child, const char *subsystem, const char *devtype, sd_device **ret); +int sd_device_get_parent(sd_device *device, sd_device **ret); +int sd_device_get_parent_with_subsystem_devtype(sd_device *device, const char *subsystem, const char *devtype, sd_device **ret); int sd_device_get_syspath(sd_device *device, const char **ret); int sd_device_get_subsystem(sd_device *device, const char **ret); diff --git a/src/systemd/sd-dhcp-client.h b/src/systemd/sd-dhcp-client.h index 0009a25742b..79dac0de6bf 100644 --- a/src/systemd/sd-dhcp-client.h +++ b/src/systemd/sd-dhcp-client.h @@ -63,10 +63,10 @@ int sd_dhcp_client_set_request_broadcast( int broadcast); int sd_dhcp_client_set_ifindex( sd_dhcp_client *client, - int interface_index); + int ifindex); int sd_dhcp_client_set_ifname( sd_dhcp_client *client, - const char *interface_name); + const char *ifname); int sd_dhcp_client_get_ifname(sd_dhcp_client *client, const char **ret); int sd_dhcp_client_set_mac( sd_dhcp_client *client, @@ -104,8 +104,8 @@ __extension__ int sd_dhcp_client_set_iaid_duid_raw( bool iaid_set, uint32_t iaid, uint16_t duid_type, - const uint8_t *duid, - size_t duid_len); + const uint8_t *duid_data, + size_t duid_data_len); __extension__ int sd_dhcp_client_set_rapid_commit( sd_dhcp_client *client, bool rapid_commit); @@ -114,7 +114,7 @@ int sd_dhcp_client_set_mtu( uint32_t mtu); int sd_dhcp_client_set_max_attempts( sd_dhcp_client *client, - uint64_t attempt); + uint64_t max_attempts); int sd_dhcp_client_set_client_port( sd_dhcp_client *client, uint16_t port); @@ -141,7 +141,7 @@ int sd_dhcp_client_set_service_type( int type); int sd_dhcp_client_set_socket_priority( sd_dhcp_client *client, - int so_priority); + int socket_priority); int sd_dhcp_client_set_fallback_lease_lifetime( sd_dhcp_client *client, uint64_t fallback_lease_lifetime); diff --git a/src/systemd/sd-dhcp-lease.h b/src/systemd/sd-dhcp-lease.h index 4bdfb5bf2dd..8554e8dceac 100644 --- a/src/systemd/sd-dhcp-lease.h +++ b/src/systemd/sd-dhcp-lease.h @@ -71,13 +71,13 @@ int sd_dhcp_lease_get_domainname(sd_dhcp_lease *lease, const char **domainname); int sd_dhcp_lease_get_search_domains(sd_dhcp_lease *lease, char ***domains); int sd_dhcp_lease_get_hostname(sd_dhcp_lease *lease, const char **hostname); int sd_dhcp_lease_get_root_path(sd_dhcp_lease *lease, const char **root_path); -int sd_dhcp_lease_get_captive_portal(sd_dhcp_lease *lease, const char **captive_portal); +int sd_dhcp_lease_get_captive_portal(sd_dhcp_lease *lease, const char **ret); int sd_dhcp_lease_get_dnr(sd_dhcp_lease *lease, sd_dns_resolver **ret_resolvers); int sd_dhcp_lease_get_static_routes(sd_dhcp_lease *lease, sd_dhcp_route ***ret); int sd_dhcp_lease_get_classless_routes(sd_dhcp_lease *lease, sd_dhcp_route ***ret); int sd_dhcp_lease_get_vendor_specific(sd_dhcp_lease *lease, const void **data, size_t *data_len); int sd_dhcp_lease_get_client_id(sd_dhcp_lease *lease, const sd_dhcp_client_id **ret); -int sd_dhcp_lease_get_timezone(sd_dhcp_lease *lease, const char **timezone); +int sd_dhcp_lease_get_timezone(sd_dhcp_lease *lease, const char **ret); int sd_dhcp_lease_get_6rd( sd_dhcp_lease *lease, uint8_t *ret_ipv4masklen, diff --git a/src/systemd/sd-dhcp-server.h b/src/systemd/sd-dhcp-server.h index 787d2f41696..f8621d9f3ae 100644 --- a/src/systemd/sd-dhcp-server.h +++ b/src/systemd/sd-dhcp-server.h @@ -60,9 +60,9 @@ int sd_dhcp_server_set_boot_server_address(sd_dhcp_server *server, const struct int sd_dhcp_server_set_boot_server_name(sd_dhcp_server *server, const char *name); int sd_dhcp_server_set_boot_filename(sd_dhcp_server *server, const char *filename); int sd_dhcp_server_set_bind_to_interface(sd_dhcp_server *server, int enabled); -int sd_dhcp_server_set_timezone(sd_dhcp_server *server, const char *timezone); +int sd_dhcp_server_set_timezone(sd_dhcp_server *server, const char *tz); int sd_dhcp_server_set_domain_name(sd_dhcp_server *server, const char *domain_name); -int sd_dhcp_server_set_router(sd_dhcp_server *server, const struct in_addr *address); +int sd_dhcp_server_set_router(sd_dhcp_server *server, const struct in_addr *router); int sd_dhcp_server_set_servers( sd_dhcp_server *server, diff --git a/src/systemd/sd-dhcp6-client.h b/src/systemd/sd-dhcp6-client.h index b388acc137b..546a68dd19d 100644 --- a/src/systemd/sd-dhcp6-client.h +++ b/src/systemd/sd-dhcp6-client.h @@ -49,10 +49,10 @@ int sd_dhcp6_client_set_callback( int sd_dhcp6_client_set_ifindex( sd_dhcp6_client *client, - int interface_index); + int ifindex); int sd_dhcp6_client_set_ifname( sd_dhcp6_client *client, - const char *interface_name); + const char *ifname); int sd_dhcp6_client_get_ifname(sd_dhcp6_client *client, const char **ret); int sd_dhcp6_client_set_local_address( sd_dhcp6_client *client, diff --git a/src/systemd/sd-dns-resolver.h b/src/systemd/sd-dns-resolver.h index a1537e8a302..80ad7d570ae 100644 --- a/src/systemd/sd-dns-resolver.h +++ b/src/systemd/sd-dns-resolver.h @@ -44,8 +44,8 @@ __extension__ typedef enum sd_dns_alpn_flags { int sd_dns_resolver_get_priority(sd_dns_resolver *res, uint16_t *ret_priority); int sd_dns_resolver_get_adn(sd_dns_resolver *res, const char **ret_adn); -int sd_dns_resolver_get_inet_addresses(sd_dns_resolver *res, const struct in_addr **ret_addrs, size_t *n); -int sd_dns_resolver_get_inet6_addresses(sd_dns_resolver *res, const struct in6_addr **ret_addrs, size_t *n); +int sd_dns_resolver_get_inet_addresses(sd_dns_resolver *res, const struct in_addr **ret_addrs, size_t *ret_n_addrs); +int sd_dns_resolver_get_inet6_addresses(sd_dns_resolver *res, const struct in6_addr **ret_addrs, size_t *ret_n_addrs); int sd_dns_resolver_get_alpn(sd_dns_resolver *res, sd_dns_alpn_flags *ret_alpn); int sd_dns_resolver_get_port(sd_dns_resolver *res, uint16_t *ret_port); int sd_dns_resolver_get_dohpath(sd_dns_resolver *res, const char **ret_dohpath); diff --git a/src/systemd/sd-event.h b/src/systemd/sd-event.h index 7f0c444cfa1..57688058e77 100644 --- a/src/systemd/sd-event.h +++ b/src/systemd/sd-event.h @@ -80,9 +80,9 @@ typedef void* sd_event_child_handler_t; typedef int (*sd_event_inotify_handler_t)(sd_event_source *s, const struct inotify_event *event, void *userdata); typedef _sd_destroy_t sd_event_destroy_t; -int sd_event_default(sd_event **e); +int sd_event_default(sd_event **ret); -int sd_event_new(sd_event **e); +int sd_event_new(sd_event **ret); sd_event* sd_event_ref(sd_event *e); sd_event* sd_event_unref(sd_event *e); @@ -100,9 +100,9 @@ int sd_event_add_exit(sd_event *e, sd_event_source **ret, sd_event_handler_t cal int sd_event_add_memory_pressure(sd_event *e, sd_event_source **ret, sd_event_handler_t callback, void *userdata); int sd_event_prepare(sd_event *e); -int sd_event_wait(sd_event *e, uint64_t usec); +int sd_event_wait(sd_event *e, uint64_t timeout); int sd_event_dispatch(sd_event *e); -int sd_event_run(sd_event *e, uint64_t usec); +int sd_event_run(sd_event *e, uint64_t timeout); int sd_event_loop(sd_event *e); int sd_event_exit(sd_event *e, int code); @@ -162,7 +162,7 @@ int sd_event_source_send_child_signal(sd_event_source *s, int sig, const void *s #endif int sd_event_source_get_inotify_mask(sd_event_source *s, uint32_t *ret); int sd_event_source_get_inotify_path(sd_event_source *s, const char **ret); -int sd_event_source_set_memory_pressure_type(sd_event_source *e, const char *ty); +int sd_event_source_set_memory_pressure_type(sd_event_source *s, const char *ty); int sd_event_source_set_memory_pressure_period(sd_event_source *s, uint64_t threshold_usec, uint64_t window_usec); int sd_event_source_set_destroy_callback(sd_event_source *s, sd_event_destroy_t callback); int sd_event_source_get_destroy_callback(sd_event_source *s, sd_event_destroy_t *ret); diff --git a/src/systemd/sd-ipv4acd.h b/src/systemd/sd-ipv4acd.h index bcc5222aec1..a7b7083ec71 100644 --- a/src/systemd/sd-ipv4acd.h +++ b/src/systemd/sd-ipv4acd.h @@ -45,9 +45,9 @@ int sd_ipv4acd_get_address(sd_ipv4acd *acd, struct in_addr *address); int sd_ipv4acd_set_callback(sd_ipv4acd *acd, sd_ipv4acd_callback_t cb, void *userdata); int sd_ipv4acd_set_check_mac_callback(sd_ipv4acd *acd, sd_ipv4acd_check_mac_callback_t cb, void *userdata); int sd_ipv4acd_set_mac(sd_ipv4acd *acd, const struct ether_addr *addr); -int sd_ipv4acd_set_ifindex(sd_ipv4acd *acd, int interface_index); +int sd_ipv4acd_set_ifindex(sd_ipv4acd *acd, int ifindex); int sd_ipv4acd_get_ifindex(sd_ipv4acd *acd); -int sd_ipv4acd_set_ifname(sd_ipv4acd *acd, const char *interface_name); +int sd_ipv4acd_set_ifname(sd_ipv4acd *acd, const char *ifname); int sd_ipv4acd_get_ifname(sd_ipv4acd *acd, const char **ret); int sd_ipv4acd_set_timeout(sd_ipv4acd *acd, uint64_t usec); int sd_ipv4acd_set_address(sd_ipv4acd *acd, const struct in_addr *address); diff --git a/src/systemd/sd-ipv4ll.h b/src/systemd/sd-ipv4ll.h index 351cce0c2fc..9462f1779e1 100644 --- a/src/systemd/sd-ipv4ll.h +++ b/src/systemd/sd-ipv4ll.h @@ -45,9 +45,9 @@ int sd_ipv4ll_set_callback(sd_ipv4ll *ll, sd_ipv4ll_callback_t cb, void *userdat int sd_ipv4ll_set_check_mac_callback(sd_ipv4ll *ll, sd_ipv4ll_check_mac_callback_t cb, void *userdata); int sd_ipv4ll_set_mac(sd_ipv4ll *ll, const struct ether_addr *addr); int sd_ipv4ll_set_timeout(sd_ipv4ll *ll, uint64_t usec); -int sd_ipv4ll_set_ifindex(sd_ipv4ll *ll, int interface_index); +int sd_ipv4ll_set_ifindex(sd_ipv4ll *ll, int ifindex); int sd_ipv4ll_get_ifindex(sd_ipv4ll *ll); -int sd_ipv4ll_set_ifname(sd_ipv4ll *ll, const char *interface_name); +int sd_ipv4ll_set_ifname(sd_ipv4ll *ll, const char *ifname); int sd_ipv4ll_get_ifname(sd_ipv4ll *ll, const char **ret); int sd_ipv4ll_set_address(sd_ipv4ll *ll, const struct in_addr *address); int sd_ipv4ll_set_address_seed(sd_ipv4ll *ll, uint64_t seed); diff --git a/src/systemd/sd-journal.h b/src/systemd/sd-journal.h index 57dc8a83327..e21a7184e3d 100644 --- a/src/systemd/sd-journal.h +++ b/src/systemd/sd-journal.h @@ -104,9 +104,9 @@ int sd_journal_get_seqnum(sd_journal *j, uint64_t *ret_seqnum, sd_id128_t *ret_s int sd_journal_set_data_threshold(sd_journal *j, size_t sz); int sd_journal_get_data_threshold(sd_journal *j, size_t *sz); -int sd_journal_get_data(sd_journal *j, const char *field, const void **data, size_t *l); -int sd_journal_enumerate_data(sd_journal *j, const void **data, size_t *l); -int sd_journal_enumerate_available_data(sd_journal *j, const void **data, size_t *l); +int sd_journal_get_data(sd_journal *j, const char *field, const void **data, size_t *length); +int sd_journal_enumerate_data(sd_journal *j, const void **data, size_t *length); +int sd_journal_enumerate_available_data(sd_journal *j, const void **data, size_t *length); void sd_journal_restart_data(sd_journal *j); int sd_journal_add_match(sd_journal *j, const void *data, size_t size); @@ -126,11 +126,11 @@ int sd_journal_test_cursor(sd_journal *j, const char *cursor); int sd_journal_get_cutoff_realtime_usec(sd_journal *j, uint64_t *from, uint64_t *to); int sd_journal_get_cutoff_monotonic_usec(sd_journal *j, const sd_id128_t boot_id, uint64_t *from, uint64_t *to); -int sd_journal_get_usage(sd_journal *j, uint64_t *bytes); +int sd_journal_get_usage(sd_journal *j, uint64_t *ret_bytes); int sd_journal_query_unique(sd_journal *j, const char *field); -int sd_journal_enumerate_unique(sd_journal *j, const void **data, size_t *l); -int sd_journal_enumerate_available_unique(sd_journal *j, const void **data, size_t *l); +int sd_journal_enumerate_unique(sd_journal *j, const void **data, size_t *length); +int sd_journal_enumerate_available_unique(sd_journal *j, const void **data, size_t *length); void sd_journal_restart_unique(sd_journal *j); int sd_journal_enumerate_fields(sd_journal *j, const char **field); @@ -143,8 +143,8 @@ int sd_journal_process(sd_journal *j); int sd_journal_wait(sd_journal *j, uint64_t timeout_usec); int sd_journal_reliable_fd(sd_journal *j); -int sd_journal_get_catalog(sd_journal *j, char **text); -int sd_journal_get_catalog_for_message_id(sd_id128_t id, char **text); +int sd_journal_get_catalog(sd_journal *j, char **ret); +int sd_journal_get_catalog_for_message_id(sd_id128_t id, char **ret); int sd_journal_has_runtime_files(sd_journal *j); int sd_journal_has_persistent_files(sd_journal *j); diff --git a/src/systemd/sd-json.h b/src/systemd/sd-json.h index 9328e4700fe..c28e5dd0e76 100644 --- a/src/systemd/sd-json.h +++ b/src/systemd/sd-json.h @@ -129,7 +129,7 @@ void sd_json_variant_sensitive(sd_json_variant *v); int sd_json_variant_is_sensitive(sd_json_variant *v); int sd_json_variant_is_sensitive_recursive(sd_json_variant *v); -int sd_json_variant_get_source(sd_json_variant *v, const char **ret_source, unsigned *ret_line, unsigned *reterr_column); +int sd_json_variant_get_source(sd_json_variant *v, const char **ret_source, unsigned *ret_line, unsigned *ret_column); __extension__ typedef enum _SD_ENUM_TYPE_S64(sd_json_format_flags_t) { SD_JSON_FORMAT_OFF = 1 << 0, /* disable json output, make json_variant_format() fail with -ENOEXEC */ diff --git a/src/systemd/sd-lldp-rx.h b/src/systemd/sd-lldp-rx.h index cb76781e1e6..8a99dddfdbc 100644 --- a/src/systemd/sd-lldp-rx.h +++ b/src/systemd/sd-lldp-rx.h @@ -58,11 +58,11 @@ int sd_lldp_rx_set_ifname(sd_lldp_rx *lldp_rx, const char *ifname); int sd_lldp_rx_get_ifname(sd_lldp_rx *lldp_rx, const char **ret); /* Controls how much and what to store in the neighbors database */ -int sd_lldp_rx_set_neighbors_max(sd_lldp_rx *lldp_rx, uint64_t n); +int sd_lldp_rx_set_neighbors_max(sd_lldp_rx *lldp_rx, uint64_t m); int sd_lldp_rx_match_capabilities(sd_lldp_rx *lldp_rx, uint16_t mask); int sd_lldp_rx_set_filter_address(sd_lldp_rx *lldp_rx, const struct ether_addr *address); -int sd_lldp_rx_get_neighbors(sd_lldp_rx *lldp_rx, sd_lldp_neighbor ***neighbors); +int sd_lldp_rx_get_neighbors(sd_lldp_rx *lldp_rx, sd_lldp_neighbor ***ret); sd_lldp_neighbor *sd_lldp_neighbor_ref(sd_lldp_neighbor *n); sd_lldp_neighbor *sd_lldp_neighbor_unref(sd_lldp_neighbor *n); diff --git a/src/systemd/sd-login.h b/src/systemd/sd-login.h index 1a730c6d094..70f05cf306f 100644 --- a/src/systemd/sd-login.h +++ b/src/systemd/sd-login.h @@ -188,7 +188,7 @@ int sd_session_get_leader(const char *session, pid_t *ret_leader); int sd_session_get_remote_host(const char *session, char **ret_remote_host); /* Determine the remote user of this session (if provided by PAM). */ -int sd_session_get_remote_user(const char *session, char **tre_remote_user); +int sd_session_get_remote_user(const char *session, char **ret_remote_user); /* Determine the TTY of this session. */ int sd_session_get_tty(const char *session, char **ret_tty); diff --git a/src/systemd/sd-ndisc-redirect.h b/src/systemd/sd-ndisc-redirect.h index 6c3a7b9f78d..444ca8bcb91 100644 --- a/src/systemd/sd-ndisc-redirect.h +++ b/src/systemd/sd-ndisc-redirect.h @@ -27,16 +27,16 @@ struct ip6_hdr; typedef struct sd_ndisc_redirect sd_ndisc_redirect; -sd_ndisc_redirect* sd_ndisc_redirect_ref(sd_ndisc_redirect *na); -sd_ndisc_redirect* sd_ndisc_redirect_unref(sd_ndisc_redirect *na); +sd_ndisc_redirect* sd_ndisc_redirect_ref(sd_ndisc_redirect *rd); +sd_ndisc_redirect* sd_ndisc_redirect_unref(sd_ndisc_redirect *rd); _SD_DEFINE_POINTER_CLEANUP_FUNC(sd_ndisc_redirect, sd_ndisc_redirect_unref); int sd_ndisc_redirect_set_sender_address(sd_ndisc_redirect *rd, const struct in6_addr *addr); -int sd_ndisc_redirect_get_sender_address(sd_ndisc_redirect *na, struct in6_addr *ret); -int sd_ndisc_redirect_get_target_address(sd_ndisc_redirect *na, struct in6_addr *ret); -int sd_ndisc_redirect_get_destination_address(sd_ndisc_redirect *na, struct in6_addr *ret); -int sd_ndisc_redirect_get_target_mac(sd_ndisc_redirect *na, struct ether_addr *ret); -int sd_ndisc_redirect_get_redirected_header(sd_ndisc_redirect *na, struct ip6_hdr *ret); +int sd_ndisc_redirect_get_sender_address(sd_ndisc_redirect *rd, struct in6_addr *ret); +int sd_ndisc_redirect_get_target_address(sd_ndisc_redirect *rd, struct in6_addr *ret); +int sd_ndisc_redirect_get_destination_address(sd_ndisc_redirect *rd, struct in6_addr *ret); +int sd_ndisc_redirect_get_target_mac(sd_ndisc_redirect *rd, struct ether_addr *ret); +int sd_ndisc_redirect_get_redirected_header(sd_ndisc_redirect *rd, struct ip6_hdr *ret); _SD_END_DECLARATIONS; diff --git a/src/systemd/sd-ndisc.h b/src/systemd/sd-ndisc.h index 57cb32ef758..1b2b2204c03 100644 --- a/src/systemd/sd-ndisc.h +++ b/src/systemd/sd-ndisc.h @@ -58,9 +58,9 @@ int sd_ndisc_attach_event(sd_ndisc *nd, sd_event *event, int64_t priority); int sd_ndisc_detach_event(sd_ndisc *nd); sd_event *sd_ndisc_get_event(sd_ndisc *nd); -int sd_ndisc_set_callback(sd_ndisc *nd, sd_ndisc_callback_t cb, void *userdata); -int sd_ndisc_set_ifindex(sd_ndisc *nd, int interface_index); -int sd_ndisc_set_ifname(sd_ndisc *nd, const char *interface_name); +int sd_ndisc_set_callback(sd_ndisc *nd, sd_ndisc_callback_t callback, void *userdata); +int sd_ndisc_set_ifindex(sd_ndisc *nd, int ifindex); +int sd_ndisc_set_ifname(sd_ndisc *nd, const char *ifname); int sd_ndisc_get_ifname(sd_ndisc *nd, const char **ret); int sd_ndisc_set_link_local_address(sd_ndisc *nd, const struct in6_addr *addr); int sd_ndisc_set_mac(sd_ndisc *nd, const struct ether_addr *mac_addr); diff --git a/src/systemd/sd-netlink.h b/src/systemd/sd-netlink.h index 59ab497b9ff..b8f0481d496 100644 --- a/src/systemd/sd-netlink.h +++ b/src/systemd/sd-netlink.h @@ -61,7 +61,7 @@ int sd_netlink_get_timeout(sd_netlink *nl, uint64_t *ret); int sd_netlink_process(sd_netlink *nl, sd_netlink_message **ret); int sd_netlink_wait(sd_netlink *nl, uint64_t timeout); -int sd_netlink_add_match(sd_netlink *nl, sd_netlink_slot **ret_slot, uint16_t match, +int sd_netlink_add_match(sd_netlink *nl, sd_netlink_slot **ret_slot, uint16_t type, sd_netlink_message_handler_t callback, sd_netlink_destroy_t destroy_callback, void *userdata, const char *description); diff --git a/src/systemd/sd-radv.h b/src/systemd/sd-radv.h index 8823049b525..7b0d96e8c22 100644 --- a/src/systemd/sd-radv.h +++ b/src/systemd/sd-radv.h @@ -34,7 +34,7 @@ sd_radv *sd_radv_ref(sd_radv *ra); sd_radv *sd_radv_unref(sd_radv *ra); int sd_radv_attach_event(sd_radv *ra, sd_event *event, int64_t priority); -int sd_radv_detach_event(sd_radv *nd); +int sd_radv_detach_event(sd_radv *ra); sd_event *sd_radv_get_event(sd_radv *ra); int sd_radv_start(sd_radv *ra); @@ -42,8 +42,8 @@ int sd_radv_stop(sd_radv *ra); int sd_radv_is_running(sd_radv *ra); int sd_radv_send(sd_radv *ra); -int sd_radv_set_ifindex(sd_radv *ra, int interface_index); -int sd_radv_set_ifname(sd_radv *ra, const char *interface_name); +int sd_radv_set_ifindex(sd_radv *ra, int ifindex); +int sd_radv_set_ifname(sd_radv *ra, const char *ifname); int sd_radv_get_ifname(sd_radv *ra, const char **ret); int sd_radv_set_link_local_address(sd_radv *ra, const struct in6_addr *addr); diff --git a/src/systemd/sd-resolve.h b/src/systemd/sd-resolve.h index ad05bd7e400..9e549050ba2 100644 --- a/src/systemd/sd-resolve.h +++ b/src/systemd/sd-resolve.h @@ -90,7 +90,7 @@ sd_event *sd_resolve_get_event(sd_resolve *resolve); * getaddrinfo(3). The function returns a new query object. When the * query is completed, you may retrieve the results using * sd_resolve_getaddrinfo_done(). */ -int sd_resolve_getaddrinfo(sd_resolve *resolve, sd_resolve_query **q, const char *node, const char *service, const struct addrinfo *hints, sd_resolve_getaddrinfo_handler_t callback, void *userdata); +int sd_resolve_getaddrinfo(sd_resolve *resolve, sd_resolve_query **ret, const char *node, const char *service, const struct addrinfo *hints, sd_resolve_getaddrinfo_handler_t callback, void *userdata); /* Issue an address-to-name query on the specified session. The * arguments are compatible with those of libc's @@ -98,7 +98,7 @@ int sd_resolve_getaddrinfo(sd_resolve *resolve, sd_resolve_query **q, const char * query is completed, you may retrieve the results using * sd_resolve_getnameinfo_done(). Set gethost (resp. getserv) to non-zero * if you want to query the hostname (resp. the service name). */ -int sd_resolve_getnameinfo(sd_resolve *resolve, sd_resolve_query **q, const struct sockaddr *sa, socklen_t salen, int flags, uint64_t get, sd_resolve_getnameinfo_handler_t callback, void *userdata); +int sd_resolve_getnameinfo(sd_resolve *resolve, sd_resolve_query **ret, const struct sockaddr *sa, socklen_t salen, int flags, uint64_t get, sd_resolve_getnameinfo_handler_t callback, void *userdata); sd_resolve_query *sd_resolve_query_ref(sd_resolve_query *q); sd_resolve_query *sd_resolve_query_unref(sd_resolve_query *q); diff --git a/src/systemd/sd-varlink.h b/src/systemd/sd-varlink.h index cf279bd551d..69ddde8e734 100644 --- a/src/systemd/sd-varlink.h +++ b/src/systemd/sd-varlink.h @@ -211,7 +211,7 @@ int sd_varlink_get_peer_gid(sd_varlink *v, gid_t *ret); int sd_varlink_get_peer_pid(sd_varlink *v, pid_t *ret); int sd_varlink_get_peer_pidfd(sd_varlink *v); -int sd_varlink_set_relative_timeout(sd_varlink *v, uint64_t usec); +int sd_varlink_set_relative_timeout(sd_varlink *v, uint64_t timeout); sd_varlink_server* sd_varlink_get_server(sd_varlink *v); @@ -261,9 +261,9 @@ int sd_varlink_server_add_interface_many_internal(sd_varlink_server *s, ...); void* sd_varlink_server_set_userdata(sd_varlink_server *s, void *userdata); void* sd_varlink_server_get_userdata(sd_varlink_server *s); -int sd_varlink_server_attach_event(sd_varlink_server *v, sd_event *e, int64_t priority); -int sd_varlink_server_detach_event(sd_varlink_server *v); -sd_event* sd_varlink_server_get_event(sd_varlink_server *v); +int sd_varlink_server_attach_event(sd_varlink_server *s, sd_event *e, int64_t priority); +int sd_varlink_server_detach_event(sd_varlink_server *s); +sd_event* sd_varlink_server_get_event(sd_varlink_server *s); int sd_varlink_server_loop_auto(sd_varlink_server *server); diff --git a/src/timesync/timesyncd-conf.h b/src/timesync/timesyncd-conf.h index 745ba74b5c7..b11a572c865 100644 --- a/src/timesync/timesyncd-conf.h +++ b/src/timesync/timesyncd-conf.h @@ -3,7 +3,7 @@ #include "timesyncd-forward.h" -const struct ConfigPerfItem* timesyncd_gperf_lookup(const char *key, GPERF_LEN_TYPE length); +const struct ConfigPerfItem* timesyncd_gperf_lookup(const char *str, GPERF_LEN_TYPE length); int manager_parse_server_string(Manager *m, ServerType type, const char *string); diff --git a/src/udev/net/link-config.h b/src/udev/net/link-config.h index b7d59a22d93..ce6016794b3 100644 --- a/src/udev/net/link-config.h +++ b/src/udev/net/link-config.h @@ -136,10 +136,10 @@ int link_get_config(LinkConfigContext *ctx, Link *link); int link_apply_config(LinkConfigContext *ctx, Link *link); const char* mac_address_policy_to_string(MACAddressPolicy p) _const_; -MACAddressPolicy mac_address_policy_from_string(const char *p) _pure_; +MACAddressPolicy mac_address_policy_from_string(const char *s) _pure_; /* gperf lookup function */ -const struct ConfigPerfItem* link_config_gperf_lookup(const char *key, GPERF_LEN_TYPE length); +const struct ConfigPerfItem* link_config_gperf_lookup(const char *str, GPERF_LEN_TYPE length); CONFIG_PARSER_PROTOTYPE(config_parse_udev_property); CONFIG_PARSER_PROTOTYPE(config_parse_udev_property_name); diff --git a/src/udev/udev-spawn.h b/src/udev/udev-spawn.h index dceab857100..42cb988e40a 100644 --- a/src/udev/udev-spawn.h +++ b/src/udev/udev-spawn.h @@ -11,7 +11,7 @@ int udev_event_spawn( bool accept_failure, const char *cmd, char *result, - size_t ressize, + size_t result_size, bool *ret_truncated); void udev_event_execute_run(UdevEvent *event); diff --git a/src/vmspawn/vmspawn-util.h b/src/vmspawn/vmspawn-util.h index d68000ee6b3..97ddbb7fc84 100644 --- a/src/vmspawn/vmspawn-util.h +++ b/src/vmspawn/vmspawn-util.h @@ -91,6 +91,6 @@ int list_ovmf_config(char ***ret); int load_ovmf_config(const char *path, OvmfConfig **ret); int find_ovmf_config(int search_sb, OvmfConfig **ret); int find_qemu_binary(char **ret_qemu_binary); -int vsock_fix_child_cid(int vsock_fd, unsigned *machine_cid, const char *machine); +int vsock_fix_child_cid(int vhost_device_fd, unsigned *machine_cid, const char *machine); char* escape_qemu_value(const char *s);