summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-07-11 19:14:16 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-07-12 14:31:12 +0900
commitb910cc72c0fb56d96bf98704450fba1f339d8527 (patch)
treec36280c1d426b1ec859ecb55872314d6a9855f35 /src/journal
parent6fa0524133ce54889f870d7ad17ab1d1832d7460 (diff)
downloadsystemd-b910cc72c0fb56d96bf98704450fba1f339d8527.tar.gz
systemd-b910cc72c0fb56d96bf98704450fba1f339d8527.tar.bz2
systemd-b910cc72c0fb56d96bf98704450fba1f339d8527.zip
tree-wide: get rid of strappend()
It's a special case of strjoin(), so no need to keep both. In particular as typing strjoin() is even shoert than strappend().
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/journalctl.c6
-rw-r--r--src/journal/journald-kmsg.c10
-rw-r--r--src/journal/journald-server.c2
-rw-r--r--src/journal/journald-stream.c6
-rw-r--r--src/journal/test-journal-flush.c3
5 files changed, 14 insertions, 13 deletions
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index 3e1ca5b1ba..764b3c217e 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -1101,19 +1101,19 @@ static int add_matches(sd_journal *j, char **args) {
if (!comm)
return log_oom();
- t = strappend("_COMM=", comm);
+ t = strjoin("_COMM=", comm);
if (!t)
return log_oom();
/* Append _EXE only if the interpreter is not a link.
Otherwise, it might be outdated often. */
if (lstat(interpreter, &st) == 0 && !S_ISLNK(st.st_mode)) {
- t2 = strappend("_EXE=", interpreter);
+ t2 = strjoin("_EXE=", interpreter);
if (!t2)
return log_oom();
}
} else {
- t = strappend("_EXE=", p);
+ t = strjoin("_EXE=", p);
if (!t)
return log_oom();
}
diff --git a/src/journal/journald-kmsg.c b/src/journal/journald-kmsg.c
index ce82102eed..366298758c 100644
--- a/src/journal/journald-kmsg.c
+++ b/src/journal/journald-kmsg.c
@@ -217,7 +217,7 @@ void dev_kmsg_record(Server *s, char *p, size_t l) {
char *b;
if (sd_device_get_devname(d, &g) >= 0) {
- b = strappend("_UDEV_DEVNODE=", g);
+ b = strjoin("_UDEV_DEVNODE=", g);
if (b) {
iovec[n++] = IOVEC_MAKE_STRING(b);
z++;
@@ -225,7 +225,7 @@ void dev_kmsg_record(Server *s, char *p, size_t l) {
}
if (sd_device_get_sysname(d, &g) >= 0) {
- b = strappend("_UDEV_SYSNAME=", g);
+ b = strjoin("_UDEV_SYSNAME=", g);
if (b) {
iovec[n++] = IOVEC_MAKE_STRING(b);
z++;
@@ -238,7 +238,7 @@ void dev_kmsg_record(Server *s, char *p, size_t l) {
if (j >= N_IOVEC_UDEV_FIELDS)
break;
- b = strappend("_UDEV_DEVLINK=", g);
+ b = strjoin("_UDEV_DEVLINK=", g);
if (b) {
iovec[n++] = IOVEC_MAKE_STRING(b);
z++;
@@ -271,13 +271,13 @@ void dev_kmsg_record(Server *s, char *p, size_t l) {
goto finish;
if (identifier) {
- syslog_identifier = strappend("SYSLOG_IDENTIFIER=", identifier);
+ syslog_identifier = strjoin("SYSLOG_IDENTIFIER=", identifier);
if (syslog_identifier)
iovec[n++] = IOVEC_MAKE_STRING(syslog_identifier);
}
if (pid) {
- syslog_pid = strappend("SYSLOG_PID=", pid);
+ syslog_pid = strjoin("SYSLOG_PID=", pid);
if (syslog_pid)
iovec[n++] = IOVEC_MAKE_STRING(syslog_pid);
}
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index ce0d9ce8c9..a0c2dcd2d0 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -737,7 +737,7 @@ static void server_cache_hostname(Server *s) {
if (!t)
return;
- x = strappend("_HOSTNAME=", t);
+ x = strjoin("_HOSTNAME=", t);
if (!x)
return;
diff --git a/src/journal/journald-stream.c b/src/journal/journald-stream.c
index 24d4ac30b2..afebadeccc 100644
--- a/src/journal/journald-stream.c
+++ b/src/journal/journald-stream.c
@@ -294,7 +294,7 @@ static int stdout_stream_log(StdoutStream *s, const char *p, LineBreak line_brea
}
if (s->identifier) {
- syslog_identifier = strappend("SYSLOG_IDENTIFIER=", s->identifier);
+ syslog_identifier = strjoin("SYSLOG_IDENTIFIER=", s->identifier);
if (syslog_identifier)
iovec[n++] = IOVEC_MAKE_STRING(syslog_identifier);
}
@@ -311,7 +311,7 @@ static int stdout_stream_log(StdoutStream *s, const char *p, LineBreak line_brea
iovec[n++] = IOVEC_MAKE_STRING(c);
}
- message = strappend("MESSAGE=", p);
+ message = strjoin("MESSAGE=", p);
if (message)
iovec[n++] = IOVEC_MAKE_STRING(message);
@@ -649,7 +649,7 @@ static int stdout_stream_load(StdoutStream *stream, const char *fname) {
assert(fname);
if (!stream->state_file) {
- stream->state_file = strappend("/run/systemd/journal/streams/", fname);
+ stream->state_file = path_join("/run/systemd/journal/streams", fname);
if (!stream->state_file)
return log_oom();
}
diff --git a/src/journal/test-journal-flush.c b/src/journal/test-journal-flush.c
index de9d23a003..50500222ad 100644
--- a/src/journal/test-journal-flush.c
+++ b/src/journal/test-journal-flush.c
@@ -10,6 +10,7 @@
#include "journal-file.h"
#include "journal-internal.h"
#include "macro.h"
+#include "path-util.h"
#include "string-util.h"
int main(int argc, char *argv[]) {
@@ -23,7 +24,7 @@ int main(int argc, char *argv[]) {
assert_se(mkdtemp(dn));
(void) chattr_path(dn, FS_NOCOW_FL, FS_NOCOW_FL, NULL);
- fn = strappend(dn, "/test.journal");
+ fn = path_join(dn, "test.journal");
r = journal_file_open(-1, fn, O_CREAT|O_RDWR, 0644, false, 0, false, NULL, NULL, NULL, NULL, &new_journal);
assert_se(r >= 0);