mirror of
https://gitlab.com/chrony/chrony.git
synced 2025-12-05 07:35:07 -05:00
Don't copy util functions in client.c
This requires moving croak() to logging.c and avoiding use of log functions in util.c.
This commit is contained in:
29
client.c
29
client.c
@@ -39,6 +39,7 @@
|
||||
#include "cmdparse.h"
|
||||
#include "pktlength.h"
|
||||
#include "memory.h"
|
||||
#include "util.h"
|
||||
|
||||
#ifdef FEAT_READLINE
|
||||
#ifdef USE_EDITLINE
|
||||
@@ -94,34 +95,6 @@ time_to_log_form(time_t t)
|
||||
return buffer;
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
|
||||
static char *
|
||||
UTI_RefidToString(unsigned long ref_id)
|
||||
{
|
||||
unsigned int a, b, c, d;
|
||||
static char result[64];
|
||||
a = (ref_id>>24) & 0xff;
|
||||
b = (ref_id>>16) & 0xff;
|
||||
c = (ref_id>> 8) & 0xff;
|
||||
d = (ref_id>> 0) & 0xff;
|
||||
snprintf(result, sizeof(result), "%c%c%c%c", a, b, c, d);
|
||||
return result;
|
||||
}
|
||||
|
||||
static char *
|
||||
UTI_IPToDottedQuad(unsigned long ip)
|
||||
{
|
||||
unsigned long a, b, c, d;
|
||||
static char result[64];
|
||||
a = (ip>>24) & 0xff;
|
||||
b = (ip>>16) & 0xff;
|
||||
c = (ip>> 8) & 0xff;
|
||||
d = (ip>> 0) & 0xff;
|
||||
snprintf(result, sizeof(result), "%ld.%ld.%ld.%ld", a, b, c, d);
|
||||
return result;
|
||||
}
|
||||
|
||||
/* ================================================== */
|
||||
/* Read a single line of commands from standard input. Eventually we
|
||||
might want to use the GNU readline library. */
|
||||
|
||||
Reference in New Issue
Block a user