diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-02-03 02:05:59 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-02-03 02:05:59 +0100 |
commit | 63c372cb9df3bee01e3bf8cd7f96f336bddda846 (patch) | |
tree | bf4d1b6e41f72927a2b58e7dd21daa0c496aaa96 /src/journal/coredump.c | |
parent | 44de0efc6e406515fc1cf8b95d9655d0d7f7ffff (diff) |
util: rework strappenda(), and rename it strjoina()
After all it is now much more like strjoin() than strappend(). At the
same time, add support for NULL sentinels, even if they are normally not
necessary.
Diffstat (limited to 'src/journal/coredump.c')
-rw-r--r-- | src/journal/coredump.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/journal/coredump.c b/src/journal/coredump.c index f6b95145d2..f7ba0191e1 100644 --- a/src/journal/coredump.c +++ b/src/journal/coredump.c @@ -634,11 +634,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 +650,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 +677,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 +752,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 +799,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); } |