X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;ds=sidebyside;f=dss.c;h=24d77eb79dbd2ab0862b2b7012b73babde542c93;hb=07ab37b55e1bf4ad7ef65fd25db84fa2a5f50f56;hp=bd9e577e3f6a6df2b94c6f48dddb9ffdeff96d39;hpb=c9fd9f2239319b95c46e49b1b7040e1a898cdcf7;p=dss.git diff --git a/dss.c b/dss.c index bd9e577..24d77eb 100644 --- a/dss.c +++ b/dss.c @@ -1709,13 +1709,17 @@ static int com_ls(void) int i; struct snapshot_list sl; struct snapshot *s; + int64_t now = get_current_time(); dss_get_snapshot_list(&sl); FOR_EACH_SNAPSHOT(s, i, &sl) { - int64_t d = 0; + int64_t d; 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); + else + d = (now - 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;