X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fcore%2Fexecute.c;h=9148d06df4697ea0fba78cc608d7d4e8dc8ba304;hb=abb26902e424c4142b68ead35676028b12249b77;hp=aad11c94aa4c6e883f1217c9229d9bb61e01c2be;hpb=099a804b11072b6be9fd32b3aa1f90b393adef98;p=elogind.git diff --git a/src/core/execute.c b/src/core/execute.c index aad11c94a..9148d06df 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -144,7 +144,7 @@ static int flags_fds(const int fds[], unsigned n_fds, bool nonblock) { return 0; } -static const char *tty_path(const ExecContext *context) { +_pure_ static const char *tty_path(const ExecContext *context) { assert(context); if (context->tty_path) @@ -509,7 +509,7 @@ fail: return r; } -static int write_confirm_message(const char *format, ...) { +_printf_attr_(1, 2) static int write_confirm_message(const char *format, ...) { int fd; va_list ap; @@ -997,7 +997,7 @@ int exec_spawn(ExecCommand *command, int r; char *line; int socket_fd; - char _cleanup_strv_free_ **files_env = NULL; + _cleanup_strv_free_ char **files_env = NULL; assert(command); assert(context); @@ -1069,7 +1069,7 @@ int exec_spawn(ExecCommand *command, const char *username = NULL, *home = NULL; uid_t uid = (uid_t) -1; gid_t gid = (gid_t) -1; - char _cleanup_strv_free_ **our_env = NULL, **pam_env = NULL, + _cleanup_strv_free_ char **our_env = NULL, **pam_env = NULL, **final_env = NULL, **final_argv = NULL; unsigned n_env = 0; bool set_access = false; @@ -1362,7 +1362,7 @@ int exec_spawn(ExecCommand *command, goto fail_child; } } else { - char _cleanup_free_ *d = NULL; + _cleanup_free_ char *d = NULL; if (asprintf(&d, "%s/%s", context->root_directory ? context->root_directory : "", @@ -1727,7 +1727,7 @@ int exec_context_load_environment(const ExecContext *c, char ***l) { int k; bool ignore = false; char **p; - glob_t _cleanup_globfree_ pglob = {}; + _cleanup_globfree_ glob_t pglob = {}; int count, n; fn = *i; @@ -1772,7 +1772,8 @@ int exec_context_load_environment(const ExecContext *c, char ***l) { return k; } /* Log invalid environment variables with filename */ - p = strv_env_clean_log(p, pglob.gl_pathv[n]); + if (p) + p = strv_env_clean_log(p, pglob.gl_pathv[n]); if (r == NULL) r = p; @@ -1836,7 +1837,7 @@ static void strv_fprintf(FILE *f, char **l) { } void exec_context_dump(ExecContext *c, FILE* f, const char *prefix) { - char ** e; + char **e; unsigned i; assert(c);