diff options
author | Everton Marques <everton.marques@gmail.com> | 2010-03-11 11:17:33 -0300 |
---|---|---|
committer | David Lamparter <equinox@opensourcerouting.org> | 2015-02-04 06:07:53 +0100 |
commit | f9e05e5f2ae7bc8352a0744d4e4b5105b60e74a4 (patch) | |
tree | 9494f4d2b84fa08b9a779e9ece9b04465572ce74 | |
parent | 034bd7fe705b03ea4025478650bd3d690bda923f (diff) | |
download | quagga-f9e05e5f2ae7bc8352a0744d4e4b5105b60e74a4.tar.bz2 quagga-f9e05e5f2ae7bc8352a0744d4e4b5105b60e74a4.tar.xz |
[pim] Version up to 0.161
-rw-r--r-- | lib/command.c | 2 | ||||
-rw-r--r-- | pimd/pim_main.c | 6 | ||||
-rw-r--r-- | pimd/pim_time.c | 38 | ||||
-rw-r--r-- | pimd/pim_version.h | 2 |
4 files changed, 37 insertions, 11 deletions
diff --git a/lib/command.c b/lib/command.c index 8870a421..a789b0f4 100644 --- a/lib/command.c +++ b/lib/command.c @@ -105,7 +105,7 @@ static struct cmd_node config_node = }; /* Default motd string. */ -static const char *default_motd = +const char *default_motd = "\r\n\ Hello, this is " QUAGGA_PROGNAME " (version " QUAGGA_VERSION ").\r\n\ " QUAGGA_COPYRIGHT "\r\n\ diff --git a/pimd/pim_main.c b/pimd/pim_main.c index 3cf1869c..2efcbb8c 100644 --- a/pimd/pim_main.c +++ b/pimd/pim_main.c @@ -285,6 +285,12 @@ Hello, this is " QUAGGA_PROGNAME " " QUAGGA_VERSION " " PIMD_PROGNAME " " PIMD_V zlog_notice("PIM_UNEXPECTED_KERNEL_UPCALL: report unexpected kernel upcall"); #endif +#ifdef HAVE_CLOCK_MONOTONIC + zlog_notice("HAVE_CLOCK_MONOTONIC"); +#else + zlog_notice("!HAVE_CLOCK_MONOTONIC"); +#endif + /* Initialize zclient "update" and "lookup" sockets */ diff --git a/pimd/pim_time.c b/pimd/pim_time.c index 63861e5c..a4b1cc46 100644 --- a/pimd/pim_time.c +++ b/pimd/pim_time.c @@ -30,12 +30,32 @@ #include "pim_time.h" -/* - see man clock_gettime - */ -static int pim_gettime(clockid_t clk_id, struct timeval *tv) +static int pim_gettime(enum quagga_clkid clkid, struct timeval *tv) +{ + int result; + + result = quagga_gettime(clkid, tv); + if (result) { + zlog_err("%s: quagga_gettime(clkid=%d) failure: errno=%d: %s", + __PRETTY_FUNCTION__, clkid, + errno, safe_strerror(errno)); + } + + return result; +} + +static int gettime_monotonic(struct timeval *tv) { - return quagga_gettime(clk_id, tv); + int result; + + result = pim_gettime(QUAGGA_CLK_MONOTONIC, tv); + if (result) { + zlog_err("%s: pim_gettime(QUAGGA_CLK_MONOTONIC=%d) failure: errno=%d: %s", + __PRETTY_FUNCTION__, CLOCK_MONOTONIC, + errno, safe_strerror(errno)); + } + + return result; } /* @@ -46,8 +66,8 @@ int64_t pim_time_monotonic_sec() { struct timeval now_tv; - if (pim_gettime(CLOCK_MONOTONIC, &now_tv)) { - zlog_err("%s: gettime(CLOCK_MONOTONIC) failure: errno=%d: %s", + if (gettime_monotonic(&now_tv)) { + zlog_err("%s: gettime_monotonic() failure: errno=%d: %s", __PRETTY_FUNCTION__, errno, safe_strerror(errno)); return -1; @@ -65,8 +85,8 @@ int64_t pim_time_monotonic_dsec() struct timeval now_tv; int64_t now_dsec; - if (pim_gettime(CLOCK_MONOTONIC, &now_tv)) { - zlog_err("%s: gettime(CLOCK_MONOTONIC) failure: errno=%d: %s", + if (gettime_monotonic(&now_tv)) { + zlog_err("%s: gettime_monotonic() failure: errno=%d: %s", __PRETTY_FUNCTION__, errno, safe_strerror(errno)); return -1; diff --git a/pimd/pim_version.h b/pimd/pim_version.h index ef75791e..2734b7ac 100644 --- a/pimd/pim_version.h +++ b/pimd/pim_version.h @@ -23,7 +23,7 @@ #ifndef PIM_VERSION_H #define PIM_VERSION_H -#define PIMD_VERSION_STR "0.160" +#define PIMD_VERSION_STR "0.161" const char * const PIMD_VERSION; |