From cfdc28028a7a55a1f9e14ff3d2e34273ef32e6a6 Mon Sep 17 00:00:00 2001
From: Sebastian Stark <stark@kamp.kyb.local>
Date: Wed, 22 Oct 2008 13:31:42 +0200
Subject: [PATCH] show human readable snapshot creation duration when listing
 snapshots.

The PRId64 macro is defined in the C99 standard. See

  http://www.opengroup.org/onlinepubs/009695399/basedefs/inttypes.h.html
---
 dss.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/dss.c b/dss.c
index af1326f..86e8382 100644
--- a/dss.c
+++ b/dss.c
@@ -964,8 +964,12 @@ static int com_ls(void)
 	struct snapshot *s;
 
 	dss_get_snapshot_list(&sl);
-	FOR_EACH_SNAPSHOT(s, i, &sl)
-		dss_msg("%u\t%s\n", s->interval, s->name);
+	FOR_EACH_SNAPSHOT(s, i, &sl) {
+		int64_t d = 0;
+		if (s->flags & SS_COMPLETE)
+			d = (s->completion_time - s->creation_time) / 60;
+		dss_msg("%u\t%s\t%3" PRId64 ":%02" PRId64 "\n", s->interval, s->name, d/60, d%60);
+	};
 	free_snapshot_list(&sl);
 	return 1;
 }
-- 
2.39.5