From c4141ba4565b0c8b0caa6349ef9336898eaed598 Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Wed, 8 Jun 2022 08:54:39 +0200 Subject: [PATCH] Restore log_prefix The slave is supposed to prefix its diagnostics with its host name. This is why warn() and die() support a log_prefix. However, the code to actually set the log prefix must have been lost. Set log_prefix to hostname on slave. --- cmirror.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmirror.c b/cmirror.c index 8ba8323..acec82b 100644 --- a/cmirror.c +++ b/cmirror.c @@ -653,6 +653,8 @@ static void slave(char *slave_path) { FILE *in = stdin; FILE *out = stdout; + log_prefix = g_get_host_name(); + EXCEPTS = g_ptr_array_new(); CLEAN = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); @@ -736,7 +738,7 @@ static void slave(char *slave_path) { continue; } if (words != 9) - die("%s: wrong number of words in index record from master: %s\n", g_get_host_name(), line); + die("wrong number of words in index record from master: %s\n", line); g_autoptr(FileInfo) fi_want = fileinfo_new_import(word); char *filename = fi_want->name;