Skip to content

Commit a5a1016

Browse files
author
Artur Zakirov
committed
Merge branch 'master' of git.postgrespro.ru:pgpro-dev/pg_probackup
2 parents 2671a0c + 10334c9 commit a5a1016

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

show.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
*/
1010

1111
#include "pg_probackup.h"
12+
#include <time.h>
1213

1314
static void show_backup_list(FILE *out, parray *backup_list);
1415
static void show_backup_detail(FILE *out, pgBackup *backup);
@@ -188,9 +189,9 @@ show_backup_list(FILE *out, parray *backup_list)
188189
int i;
189190

190191
/* show header */
191-
fputs("=========================================================================================================\n", out);
192-
fputs("ID Recovery time Mode Current/Parent TLI Time Data start_lsn stop_lsn Status \n", out);
193-
fputs("=========================================================================================================\n", out);
192+
fputs("=============================================================================================================\n", out);
193+
fputs("ID Recovery time Mode Current/Parent TLI Time Data start_lsn stop_lsn Status \n", out);
194+
fputs("=============================================================================================================\n", out);
194195

195196
for (i = 0; i < parray_num(backup_list); i++)
196197
{
@@ -204,8 +205,8 @@ show_backup_list(FILE *out, parray *backup_list)
204205
if (backup->recovery_time != (time_t) 0)
205206
time2iso(timestamp, lengthof(timestamp), backup->recovery_time);
206207
if (backup->end_time != (time_t) 0)
207-
snprintf(duration, lengthof(duration), "%lum",
208-
(backup->end_time - backup->start_time) / 60);
208+
snprintf(duration, lengthof(duration), "%.*lf s", 0,
209+
difftime(backup->end_time, backup->start_time));
209210

210211
/*
211212
* Calculate Data field, in the case of full backup this shows the
@@ -218,7 +219,7 @@ show_backup_list(FILE *out, parray *backup_list)
218219
/* Get parent timeline before printing */
219220
parent_tli = get_parent_tli(backup->tli);
220221

221-
fprintf(out, "%-8s %-19s %-13s %2d /%2d %5s %6s %X/%X %X/%X %s \n",
222+
fprintf(out, "%-8s %-19s %-13s %2d /%2d %-10s %6s %X/%X %X/%X %s \n",
222223
base36enc(backup->start_time),
223224
timestamp,
224225
modes[backup->backup_mode + (BACKUP_MODE_FULL + 1)*backup->stream],

0 commit comments

Comments
 (0)