summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2015-08-03 17:58:54 +0200
committerTom Gundersen <teg@jklm.no>2015-08-03 17:58:54 +0200
commit9317cbecf8b06295cd67a3db2f91a8d60788ea24 (patch)
tree645f625be1e15c1066fda6663f633de51b96f6bd
parent6934f402cded89a988e8d7f93bf0b7b4eb8f17f3 (diff)
parent27ec691bfd4088b678aa18d0bad90be47d0357f4 (diff)
Merge pull request #844 from poettering/clock-boottime2
tree-wide: convert bootchart and lldp code to use clock_boottime_or_m…
-rw-r--r--src/bootchart/bootchart.c2
-rw-r--r--src/libsystemd-network/sd-lldp.c4
-rw-r--r--src/network/networkctl.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/bootchart/bootchart.c b/src/bootchart/bootchart.c
index 1625d51fa8..322cec84a9 100644
--- a/src/bootchart/bootchart.c
+++ b/src/bootchart/bootchart.c
@@ -367,7 +367,7 @@ int main(int argc, char *argv[]) {
struct timespec n;
double uptime;
- clock_gettime(CLOCK_BOOTTIME, &n);
+ clock_gettime(clock_boottime_or_monotonic(), &n);
uptime = (n.tv_sec + (n.tv_nsec / (double) NSEC_PER_SEC));
log_start = gettime_ns();
diff --git a/src/libsystemd-network/sd-lldp.c b/src/libsystemd-network/sd-lldp.c
index 034163eb9e..574e04b541 100644
--- a/src/libsystemd-network/sd-lldp.c
+++ b/src/libsystemd-network/sd-lldp.c
@@ -392,7 +392,7 @@ static void lldp_mib_delete_objects(sd_lldp *lldp) {
break;
if (t <= 0)
- t = now(CLOCK_BOOTTIME);
+ t = now(clock_boottime_or_monotonic());
if (p->until > t)
break;
@@ -490,7 +490,7 @@ int sd_lldp_save(sd_lldp *lldp, const char *lldp_file) {
free(s);
s = k;
- time = now(CLOCK_BOOTTIME);
+ time = now(clock_boottime_or_monotonic());
/* Don't write expired packets */
if (time - p->until <= 0)
diff --git a/src/network/networkctl.c b/src/network/networkctl.c
index 9d6c453dbc..6c36a4ecfa 100644
--- a/src/network/networkctl.c
+++ b/src/network/networkctl.c
@@ -976,7 +976,7 @@ static int link_lldp_status(int argc, char *argv[], void *userdata) {
return log_warning_errno(r < 0 ? r : ERANGE,
"Failed to parse TTL \"%s\": %m", b);
- time = now(CLOCK_BOOTTIME);
+ time = now(clock_boottime_or_monotonic());
if (x < time)
continue;