From 0f018a732469b5cf4a6791886c95400fecca690a Mon Sep 17 00:00:00 2001 From: Martin Willi Date: Thu, 28 Jun 2012 11:56:40 +0200 Subject: [PATCH] Show some uname() info in "ipsec statusall" --- src/libcharon/plugins/stroke/stroke_list.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/libcharon/plugins/stroke/stroke_list.c b/src/libcharon/plugins/stroke/stroke_list.c index 294e5066bc..89bd1a79ed 100644 --- a/src/libcharon/plugins/stroke/stroke_list.c +++ b/src/libcharon/plugins/stroke/stroke_list.c @@ -17,6 +17,7 @@ #include #include +#include #ifdef HAVE_MALLINFO #include @@ -453,12 +454,18 @@ METHOD(stroke_list_t, status, void, u_int32_t dpd; time_t since, now; u_int size, online, offline, i; + struct utsname utsname; + now = time_monotonic(NULL); since = time(NULL) - (now - this->uptime); - fprintf(out, "Status of IKE charon daemon (%sSwan "VERSION"):\n", - this->swan); - fprintf(out, " uptime: %V, since %T\n", &now, &this->uptime, &since, + fprintf(out, "Status of IKE charon daemon (%sSwan "VERSION, this->swan); + if (uname(&utsname) == 0) + { + fprintf(out, ", %s %s, %s", + utsname.sysname, utsname.release, utsname.machine); + } + fprintf(out, "):\n uptime: %V, since %T\n", &now, &this->uptime, &since, FALSE); #ifdef HAVE_MALLINFO { -- 2.47.2