From: Jorge Pereira Date: Sat, 25 May 2019 01:48:46 +0000 (-0300) Subject: radsnmap: Update to use fr_time_delta_t X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=eaa36d1655ebad4ce267b34eee5e2983670cf45f;p=thirdparty%2Ffreeradius-server.git radsnmap: Update to use fr_time_delta_t --- diff --git a/src/bin/radsnmp.c b/src/bin/radsnmp.c index f895c7e1fb9..a190d741a81 100644 --- a/src/bin/radsnmp.c +++ b/src/bin/radsnmp.c @@ -88,7 +88,7 @@ typedef struct { uint16_t server_port; //!< Port to send requests to. unsigned int retries; //!< Number of retries. - struct timeval timeout; + fr_time_t timeout; char *secret; //!< Shared secret. } radsnmp_conf_t; @@ -813,7 +813,7 @@ static int radsnmp_send_recv(radsnmp_conf_t *conf, int fd) return EXIT_FAILURE; } - rcode = select(fd + 1, &set, NULL, NULL, &conf->timeout); + rcode = select(fd + 1, &set, NULL, NULL, &fr_time_delta_to_timeval(conf->timeout)); switch (rcode) { case -1: ERROR("Select failed: %s", fr_syserror(errno)); @@ -919,7 +919,7 @@ int main(int argc, char **argv) conf->dict_dir = DICTDIR; conf->raddb_dir = RADDBDIR; conf->secret = talloc_strdup(conf, "testing123"); - conf->timeout.tv_sec = 3; + conf->timeout = fr_time_delta_from_sec(3); conf->retries = 5; #ifndef NDEBUG @@ -1014,7 +1014,7 @@ int main(int argc, char **argv) break; case 't': - if (fr_timeval_from_str(&conf->timeout, optarg) < 0) { + if (fr_time_delta_from_str(&conf->timeout, optarg, FR_TIME_RES_SEC) < 0) { ERROR("Failed parsing timeout value %s", fr_strerror()); exit(EXIT_FAILURE); }