X-Git-Url: http://git.tuebingen.mpg.de/dss.git/log?a=blobdiff_plain;f=dss.c;h=122472ec49a448e7166cdb0b70e1ea1e0b356931;hb=dfe40aec1c2e651fdb3b62b0bcae52a5dfb1aa8d;hp=3e626ab0113b1890277da115ea6c735dbdb690d7;hpb=3e8d431fb78e95c0d595b6e7e37ff248c0fa4edd;p=dss.git diff --git a/dss.c b/dss.c index 3e626ab..122472e 100644 --- a/dss.c +++ b/dss.c @@ -1683,13 +1683,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;