summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-06-22 20:02:46 +0200
committerGitHub <noreply@github.com>2019-06-22 20:02:46 +0200
commitcee97d57687e93e07a8ee36edf0e0d0f3317fccc (patch)
tree7278ba990e750ae119cacfd6c19a0866579374ab /src/journal
parent4c1567f29aeb60a6741874bca8a8e3a0bd69ed01 (diff)
parenta13de89d361e830f603f25011896e94d5256299d (diff)
downloadsystemd-cee97d57687e93e07a8ee36edf0e0d0f3317fccc.tar.gz
systemd-cee97d57687e93e07a8ee36edf0e0d0f3317fccc.tar.bz2
systemd-cee97d57687e93e07a8ee36edf0e0d0f3317fccc.zip
Merge pull request #12836 from yuwata/tree-wide-replace-strjoin
tree-wide: replace strjoin() with path_join()
Diffstat (limited to 'src/journal')
-rw-r--r--src/journal/journald-server.c4
-rw-r--r--src/journal/sd-journal.c5
2 files changed, 3 insertions, 6 deletions
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index 2a4fc250c9..50ccc80e87 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -2192,8 +2192,8 @@ int server_init(Server *s) {
server_cache_boot_id(s);
server_cache_machine_id(s);
- s->runtime_storage.path = strjoin("/run/log/journal/", SERVER_MACHINE_ID(s));
- s->system_storage.path = strjoin("/var/log/journal/", SERVER_MACHINE_ID(s));
+ s->runtime_storage.path = path_join("/run/log/journal", SERVER_MACHINE_ID(s));
+ s->system_storage.path = path_join("/var/log/journal", SERVER_MACHINE_ID(s));
if (!s->runtime_storage.path || !s->system_storage.path)
return -ENOMEM;
diff --git a/src/journal/sd-journal.c b/src/journal/sd-journal.c
index 40baf2b374..a4f1731613 100644
--- a/src/journal/sd-journal.c
+++ b/src/journal/sd-journal.c
@@ -1553,10 +1553,7 @@ static int add_directory(sd_journal *j, const char *prefix, const char *dirname)
/* Adds a journal file directory to watch. If the directory is already tracked this updates the inotify watch
* and reenumerates directory contents */
- if (dirname)
- path = strjoin(prefix, "/", dirname);
- else
- path = strdup(prefix);
+ path = path_join(prefix, dirname);
if (!path) {
r = -ENOMEM;
goto fail;