diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2018-10-27 07:49:28 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-27 07:49:28 +0900 |
commit | 9c3c438514bf4fbadde93d5a0a9e1dd91a577342 (patch) | |
tree | 29c442a148f7edec9f4674d7091fe1f5b9cb8605 | |
parent | 9bf7dba739379e6644a6950834f271f028a2e73f (diff) | |
parent | 6897dfe85a70b5a2a2a7c248560b75496e401363 (diff) | |
download | systemd-9c3c438514bf4fbadde93d5a0a9e1dd91a577342.tar.gz |
Merge pull request #10537 from poettering/sentinelimania
add some missing _sentinel_ decorators
-rw-r--r-- | src/basic/conf-files.h | 4 | ||||
-rw-r--r-- | src/basic/os-util.h | 2 | ||||
-rw-r--r-- | src/basic/process-util.h | 2 | ||||
-rw-r--r-- | src/core/execute.c | 3 | ||||
-rw-r--r-- | src/core/execute.h | 4 |
5 files changed, 8 insertions, 7 deletions
diff --git a/src/basic/conf-files.h b/src/basic/conf-files.h index 744ff80c09..81ebcd46b6 100644 --- a/src/basic/conf-files.h +++ b/src/basic/conf-files.h @@ -1,6 +1,8 @@ /* SPDX-License-Identifier: LGPL-2.1+ */ #pragma once +#include "macro.h" + enum { CONF_FILES_EXECUTABLE = 1 << 0, CONF_FILES_REGULAR = 1 << 1, @@ -9,7 +11,7 @@ enum { CONF_FILES_FILTER_MASKED = 1 << 4, }; -int conf_files_list(char ***ret, const char *suffix, const char *root, unsigned flags, const char *dir, ...); +int conf_files_list(char ***ret, const char *suffix, const char *root, unsigned flags, const char *dir, ...) _sentinel_; int conf_files_list_strv(char ***ret, const char *suffix, const char *root, unsigned flags, const char* const* dirs); int conf_files_list_nulstr(char ***ret, const char *suffix, const char *root, unsigned flags, const char *dirs); int conf_files_insert(char ***strv, const char *root, char **dirs, const char *path); diff --git a/src/basic/os-util.h b/src/basic/os-util.h index 6b9e033941..27ec7ac8d7 100644 --- a/src/basic/os-util.h +++ b/src/basic/os-util.h @@ -8,5 +8,5 @@ int path_is_os_tree(const char *path); int open_os_release(const char *root, char **ret_path, int *ret_fd); int fopen_os_release(const char *root, char **ret_path, FILE **ret_file); -int parse_os_release(const char *root, ...); +int parse_os_release(const char *root, ...) _sentinel_; int load_os_release_pairs(const char *root, char ***ret); diff --git a/src/basic/process-util.h b/src/basic/process-util.h index 00b07517e6..ca4e4401a9 100644 --- a/src/basic/process-util.h +++ b/src/basic/process-util.h @@ -159,7 +159,7 @@ static inline int safe_fork(const char *name, ForkFlags flags, pid_t *ret_pid) { return safe_fork_full(name, NULL, 0, flags, ret_pid); } -int fork_agent(const char *name, const int except[], size_t n_except, pid_t *pid, const char *path, ...); +int fork_agent(const char *name, const int except[], size_t n_except, pid_t *pid, const char *path, ...) _sentinel_; int set_oom_score_adjust(int value); diff --git a/src/core/execute.c b/src/core/execute.c index b531dedf32..89964b7bc1 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -4659,8 +4659,7 @@ int exec_command_set(ExecCommand *c, const char *path, ...) { return -ENOMEM; } - free(c->path); - c->path = p; + free_and_replace(c->path, p); return strv_free_and_replace(c->argv, l); } diff --git a/src/core/execute.h b/src/core/execute.h index a2ed477ebf..fa08746260 100644 --- a/src/core/execute.h +++ b/src/core/execute.h @@ -352,8 +352,8 @@ void exec_command_reset_status_array(ExecCommand *c, size_t n); void exec_command_reset_status_list_array(ExecCommand **c, size_t n); void exec_command_dump_list(ExecCommand *c, FILE *f, const char *prefix); void exec_command_append_list(ExecCommand **l, ExecCommand *e); -int exec_command_set(ExecCommand *c, const char *path, ...); -int exec_command_append(ExecCommand *c, const char *path, ...); +int exec_command_set(ExecCommand *c, const char *path, ...) _sentinel_; +int exec_command_append(ExecCommand *c, const char *path, ...) _sentinel_; void exec_context_init(ExecContext *c); void exec_context_done(ExecContext *c); |