X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fjournal%2Fcoredump.c;h=6357d3e277295b3fde0f95ea24f9984cd386c152;hb=32a568fb90bf0a22a3007fa670305403a5d0bb72;hp=f6b95145d20d22bd8fd33c13c09a966cd1e44007;hpb=f11943c53ec181829a821c6b27acf828bab71caa;p=elogind.git diff --git a/src/journal/coredump.c b/src/journal/coredump.c index f6b95145d..6357d3e27 100644 --- a/src/journal/coredump.c +++ b/src/journal/coredump.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #ifdef HAVE_ELFUTILS @@ -44,7 +43,6 @@ #include "conf-parser.h" #include "copy.h" #include "stacktrace.h" -#include "path-util.h" #include "compress.h" #include "acl-util.h" #include "capability.h" @@ -634,11 +632,11 @@ int main(int argc, char* argv[]) { goto finish; } - core_unit = strappenda("COREDUMP_UNIT=", t); + core_unit = strjoina("COREDUMP_UNIT=", t); free(t); } else if (cg_pid_get_user_unit(pid, &t) >= 0) { - core_unit = strappenda("COREDUMP_USER_UNIT=", t); + core_unit = strjoina("COREDUMP_USER_UNIT=", t); free(t); } @@ -650,20 +648,20 @@ int main(int argc, char* argv[]) { log_set_target(LOG_TARGET_JOURNAL_OR_KMSG); log_open(); - core_pid = strappenda("COREDUMP_PID=", info[INFO_PID]); + core_pid = strjoina("COREDUMP_PID=", info[INFO_PID]); IOVEC_SET_STRING(iovec[j++], core_pid); - core_uid = strappenda("COREDUMP_UID=", info[INFO_UID]); + core_uid = strjoina("COREDUMP_UID=", info[INFO_UID]); IOVEC_SET_STRING(iovec[j++], core_uid); - core_gid = strappenda("COREDUMP_GID=", info[INFO_GID]); + core_gid = strjoina("COREDUMP_GID=", info[INFO_GID]); IOVEC_SET_STRING(iovec[j++], core_gid); - core_signal = strappenda("COREDUMP_SIGNAL=", info[INFO_SIGNAL]); + core_signal = strjoina("COREDUMP_SIGNAL=", info[INFO_SIGNAL]); IOVEC_SET_STRING(iovec[j++], core_signal); if (sd_pid_get_session(pid, &t) >= 0) { - core_session = strappenda("COREDUMP_SESSION=", t); + core_session = strjoina("COREDUMP_SESSION=", t); free(t); IOVEC_SET_STRING(iovec[j++], core_session); @@ -677,31 +675,31 @@ int main(int argc, char* argv[]) { } if (sd_pid_get_slice(pid, &t) >= 0) { - core_slice = strappenda("COREDUMP_SLICE=", t); + core_slice = strjoina("COREDUMP_SLICE=", t); free(t); IOVEC_SET_STRING(iovec[j++], core_slice); } if (comm) { - core_comm = strappenda("COREDUMP_COMM=", comm); + core_comm = strjoina("COREDUMP_COMM=", comm); IOVEC_SET_STRING(iovec[j++], core_comm); } if (exe) { - core_exe = strappenda("COREDUMP_EXE=", exe); + core_exe = strjoina("COREDUMP_EXE=", exe); IOVEC_SET_STRING(iovec[j++], core_exe); } if (get_process_cmdline(pid, 0, false, &t) >= 0) { - core_cmdline = strappenda("COREDUMP_CMDLINE=", t); + core_cmdline = strjoina("COREDUMP_CMDLINE=", t); free(t); IOVEC_SET_STRING(iovec[j++], core_cmdline); } if (cg_pid_get_path_shifted(pid, NULL, &t) >= 0) { - core_cgroup = strappenda("COREDUMP_CGROUP=", t); + core_cgroup = strjoina("COREDUMP_CGROUP=", t); free(t); IOVEC_SET_STRING(iovec[j++], core_cgroup); @@ -752,14 +750,14 @@ int main(int argc, char* argv[]) { } if (get_process_cwd(pid, &t) >= 0) { - core_cwd = strappenda("COREDUMP_CWD=", t); + core_cwd = strjoina("COREDUMP_CWD=", t); free(t); IOVEC_SET_STRING(iovec[j++], core_cwd); } if (get_process_root(pid, &t) >= 0) { - core_root = strappenda("COREDUMP_ROOT=", t); + core_root = strjoina("COREDUMP_ROOT=", t); free(t); IOVEC_SET_STRING(iovec[j++], core_root); @@ -799,7 +797,7 @@ int main(int argc, char* argv[]) { if (r == 0) { const char *coredump_filename; - coredump_filename = strappenda("COREDUMP_FILENAME=", filename); + coredump_filename = strjoina("COREDUMP_FILENAME=", filename); IOVEC_SET_STRING(iovec[j++], coredump_filename); }