diff options
| author | Sebastian Stark <stark@kamp.kyb.local> | 2008-10-22 13:31:42 +0200 |
|---|---|---|
| committer | Sebastian Stark <stark@kamp.kyb.local> | 2008-10-22 13:31:42 +0200 |
| commit | cfdc28028a7a55a1f9e14ff3d2e34273ef32e6a6 (patch) | |
| tree | 9fbc4b515bc427c82232fbc49d562e18a3c80c5b | |
| parent | 7ce5c98850d6888586eaceb88da809286e751f96 (diff) | |
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
| -rw-r--r-- | dss.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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; } |
