<p>laforge <strong>submitted</strong> this change.</p><p><a href="https://gerrit.osmocom.org/c/osmo-hlr/+/16214">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">hlr_vty_subscr: prettier output for last LU seen<br><br>Extend the "last LU seen on ..." line with the amount of seconds that<br>passed since now, or "(invalid timestamp)".<br><br>Patch split from Id7fc50567211a0870ac0524f6dee94d4513781ba, because it<br>depends on timestamp_age which was just added in<br>Ife4a61d71926d08f310a1aeed9d9f1974f64178b.<br><br>Change-Id: I24f9e86c1aa0b1576290094e024562f41b988f37<br>---<br>M src/hlr_vty_subscr.c<br>1 file changed, 7 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/hlr_vty_subscr.c b/src/hlr_vty_subscr.c</span><br><span>index b561636..14a37f2 100644</span><br><span>--- a/src/hlr_vty_subscr.c</span><br><span>+++ b/src/hlr_vty_subscr.c</span><br><span>@@ -30,6 +30,7 @@</span><br><span> </span><br><span> #include <osmocom/hlr/hlr.h></span><br><span> #include <osmocom/hlr/db.h></span><br><span style="color: hsl(120, 100%, 40%);">+#include <osmocom/hlr/timestamp.h></span><br><span> </span><br><span> struct vty;</span><br><span> </span><br><span>@@ -49,11 +50,15 @@</span><br><span> </span><br><span> static void dump_last_lu_seen(struct vty *vty, const char *domain_label, time_t last_lu_seen)</span><br><span> {</span><br><span style="color: hsl(120, 100%, 40%);">+    uint32_t age;</span><br><span>        char datebuf[26]; /* for ctime_r(3) */</span><br><span>       if (!last_lu_seen)</span><br><span>           return;</span><br><span style="color: hsl(0, 100%, 40%);">- vty_out(vty, "    last LU seen on %s: %s UTC%s", domain_label, get_datestr(&last_lu_seen, datebuf),</span><br><span style="color: hsl(0, 100%, 40%);">-               VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+ vty_out(vty, "    last LU seen on %s: %s UTC", domain_label, get_datestr(&last_lu_seen, datebuf));</span><br><span style="color: hsl(120, 100%, 40%);">+      if (!timestamp_age(&last_lu_seen, &age))</span><br><span style="color: hsl(120, 100%, 40%);">+              vty_out(vty, " (invalid timestamp)%s", VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+        else</span><br><span style="color: hsl(120, 100%, 40%);">+          vty_out(vty, " (%us ago)%s", age, VTY_NEWLINE);</span><br><span> }</span><br><span> </span><br><span> static void subscr_dump_full_vty(struct vty *vty, struct hlr_subscriber *subscr)</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/osmo-hlr/+/16214">change 16214</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/osmo-hlr/+/16214"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: osmo-hlr </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I24f9e86c1aa0b1576290094e024562f41b988f37 </div>
<div style="display:none"> Gerrit-Change-Number: 16214 </div>
<div style="display:none"> Gerrit-PatchSet: 35 </div>
<div style="display:none"> Gerrit-Owner: osmith <osmith@sysmocom.de> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins Builder </div>
<div style="display:none"> Gerrit-Reviewer: laforge <laforge@osmocom.org> </div>
<div style="display:none"> Gerrit-Reviewer: pespin <pespin@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>