summaryrefslogtreecommitdiff
path: root/src/journal
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-06-21 03:07:01 +0900
committerYu Watanabe <watanabe.yu+github@gmail.com>2019-06-21 03:26:16 +0900
commit657ee2d82b73818d0ee8c3c5962c1cb2dbd52b76 (patch)
tree3624791030beb2dfd75b654f24cf818a1c6444e2 /src/journal
parentf9dc94408d70dd2f44915f4c6d67dc498c1c6243 (diff)
downloadsystemd-657ee2d82b73818d0ee8c3c5962c1cb2dbd52b76.tar.gz
systemd-657ee2d82b73818d0ee8c3c5962c1cb2dbd52b76.tar.bz2
systemd-657ee2d82b73818d0ee8c3c5962c1cb2dbd52b76.zip
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;