int status;
int socktype;
- socklen_t socklen = sizeof (socklen_t);
- int so_keepalive = 1;
-
- status = getsockopt (sockfd, SOL_SOCKET, SO_TYPE, &socktype, &socklen);
+ status = getsockopt (sockfd, SOL_SOCKET, SO_TYPE,
+ &socktype, &(socklen_t) { sizeof (socktype) });
if (status != 0)
{
WARNING ("set_sock_opts: failed to determine socket type");
if (socktype == SOCK_STREAM)
{
status = setsockopt(sockfd, SOL_SOCKET, SO_KEEPALIVE,
- &so_keepalive, sizeof (so_keepalive));
+ &(int) {1}, sizeof (int));
if (status != 0)
WARNING ("set_sock_opts: failed to set socket keepalive flag");
struct tm timestamp_tm;
char timestamp_str[64];
const unsigned char *buf;
- time_t tt;
#if HAVE_YAJL_V2
size_t len;
#else
yajl_gen_status_ok)
goto err;
- tt = CDTIME_T_TO_TIME_T (timestamp_time);
- gmtime_r (&tt, ×tamp_tm);
+ gmtime_r (&CDTIME_T_TO_TIME_T (timestamp_time), ×tamp_tm);
/*
* format time as a UTC ISO 8601 compliant string
{
FILE *fh;
_Bool do_close = 0;
- struct tm timestamp_tm;
char timestamp_str[64];
char level_str[16] = "";
if (print_timestamp)
{
- time_t tt = CDTIME_T_TO_TIME_T (timestamp_time);
- localtime_r (&tt, ×tamp_tm);
+ struct tm timestamp_tm;
+ localtime_r (&CDTIME_T_TO_TIME_T (timestamp_time), ×tamp_tm);
strftime (timestamp_str, sizeof (timestamp_str), "%Y-%m-%d %H:%M:%S",
×tamp_tm);
user_data_t __attribute__((unused)) *user_data)
{
- time_t tt;
struct tm timestamp_tm;
char timestamp_str[64];
(email_subject == NULL) ? DEFAULT_SMTP_SUBJECT : email_subject,
severity, n->host);
- tt = CDTIME_T_TO_TIME_T (n->time);
- localtime_r (&tt, ×tamp_tm);
+ localtime_r (&CDTIME_T_TO_TIME_T (n->time), ×tamp_tm);
strftime (timestamp_str, sizeof (timestamp_str), "%Y-%m-%d %H:%M:%S",
×tamp_tm);
timestamp_str[sizeof (timestamp_str) - 1] = '\0';
}
st->starttls = 0;
- st->timeout = (long) (CDTIME_T_TO_MS(plugin_get_interval()) / 1000);
+ st->timeout = (long) CDTIME_T_TO_TIME_T(plugin_get_interval());
st->verifyhost = 1;
st->version = LDAP_VERSION3;