1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-10 16:58:47 +03:00

metadata: format_text: reuse _print_timestamp fn

This commit is contained in:
Peter Rajnoha 2016-03-01 15:21:05 +01:00
parent 3a0ef77305
commit 54d3d976c7

View File

@ -675,8 +675,6 @@ static int _print_lv(struct formatter *f, struct logical_volume *lv)
struct lv_segment *seg;
char buffer[4096];
int seg_count;
struct tm *local_tm;
time_t ts;
uint64_t status = lv->status;
outnl(f);
@ -705,16 +703,10 @@ static int _print_lv(struct formatter *f, struct logical_volume *lv)
return_0;
if (lv->timestamp) {
ts = (time_t)lv->timestamp;
strncpy(buffer, "# ", sizeof(buffer));
if (!(local_tm = localtime(&ts)) ||
!strftime(buffer + 2, sizeof(buffer) - 2,
"%Y-%m-%d %T %z", local_tm))
buffer[0] = 0;
if (!_print_timestamp(f, "creation_time", lv->timestamp,
buffer, sizeof(buffer)))
return_0;
outf(f, "creation_host = \"%s\"", lv->hostname);
outfc(f, buffer, "creation_time = %" PRIu64,
lv->timestamp);
}
if (lv->lock_args)