mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-03 17:45:07 -05:00
sources: don't print NULL string to dump file
For reference clocks, which don't have a name, print "." instead of
NULL.
Fixes: f8610d69f0 ("sources: improve handling of dump files and their format")
This commit is contained in:
@@ -1368,7 +1368,7 @@ save_source(SRC_Instance inst)
|
|||||||
if (!f)
|
if (!f)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ntp_name = inst->type == SRC_NTP ? NSR_GetName(inst->ip_addr) : NULL;
|
ntp_name = inst->type == SRC_NTP ? NSR_GetName(inst->ip_addr) : ".";
|
||||||
|
|
||||||
if (fprintf(f, "%s%s\n%d %o %d %d %d\n",
|
if (fprintf(f, "%s%s\n%d %o %d %d %d\n",
|
||||||
DUMP_IDENTIFIER, ntp_name, inst->authenticated,
|
DUMP_IDENTIFIER, ntp_name, inst->authenticated,
|
||||||
|
|||||||
Reference in New Issue
Block a user