Skip to content

Commit

Permalink
Restore log_prefix
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
donald committed Jun 8, 2022
1 parent ea00fe4 commit c4141ba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmirror.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c4141ba

Please sign in to comment.