Changeset View
Changeset View
Standalone View
Standalone View
head/contrib/ntp/ntpd/ntp_util.c
Show First 20 Lines • Show All 328 Lines • ▼ Show 20 Lines | |||||
void | void | ||||
stats_config( | stats_config( | ||||
int item, | int item, | ||||
const char *invalue /* only one type so far */ | const char *invalue /* only one type so far */ | ||||
) | ) | ||||
{ | { | ||||
FILE *fp; | FILE *fp; | ||||
const char *value; | const char *value; | ||||
int len; | size_t len; | ||||
double old_drift; | double old_drift; | ||||
l_fp now; | l_fp now; | ||||
time_t ttnow; | time_t ttnow; | ||||
#ifndef VMS | #ifndef VMS | ||||
const char temp_ext[] = ".TEMP"; | const char temp_ext[] = ".TEMP"; | ||||
#else | #else | ||||
const char temp_ext[] = "-TEMP"; | const char temp_ext[] = "-TEMP"; | ||||
#endif | #endif | ||||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Lines | case STATS_STATSDIR: | ||||
/* - 1 since value may be missing the DIR_SEP. */ | /* - 1 since value may be missing the DIR_SEP. */ | ||||
if (strlen(value) >= sizeof(statsdir) - 1) { | if (strlen(value) >= sizeof(statsdir) - 1) { | ||||
msyslog(LOG_ERR, | msyslog(LOG_ERR, | ||||
"statsdir too long (>%d, sigh)", | "statsdir too long (>%d, sigh)", | ||||
(int)sizeof(statsdir) - 2); | (int)sizeof(statsdir) - 2); | ||||
} else { | } else { | ||||
int add_dir_sep; | int add_dir_sep; | ||||
int value_l; | size_t value_l; | ||||
/* Add a DIR_SEP unless we already have one. */ | /* Add a DIR_SEP unless we already have one. */ | ||||
value_l = strlen(value); | value_l = strlen(value); | ||||
if (0 == value_l) | if (0 == value_l) | ||||
add_dir_sep = FALSE; | add_dir_sep = FALSE; | ||||
else | else | ||||
add_dir_sep = (DIR_SEP != | add_dir_sep = (DIR_SEP != | ||||
value[value_l - 1]); | value[value_l - 1]); | ||||
▲ Show 20 Lines • Show All 479 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* getauthkeys - read the authentication keys from the specified file | * getauthkeys - read the authentication keys from the specified file | ||||
*/ | */ | ||||
void | void | ||||
getauthkeys( | getauthkeys( | ||||
const char *keyfile | const char *keyfile | ||||
) | ) | ||||
{ | { | ||||
int len; | size_t len; | ||||
len = strlen(keyfile); | len = strlen(keyfile); | ||||
if (!len) | if (!len) | ||||
return; | return; | ||||
#ifndef SYS_WINNT | #ifndef SYS_WINNT | ||||
key_file_name = erealloc(key_file_name, len + 1); | key_file_name = erealloc(key_file_name, len + 1); | ||||
memcpy(key_file_name, keyfile, len + 1); | memcpy(key_file_name, keyfile, len + 1); | ||||
▲ Show 20 Lines • Show All 87 Lines • Show Last 20 Lines |