Changeset: a59265b29d49 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=a59265b29d49
Modified Files:
tools/merovingian/client/monetdb.c
Branch: Feb2013
Log Message:
status: fix crash for new databases
avoid a division by zero, while at the occasion, make sure we always
print the remarks field, unrelated to whether the database ever started
up before
diffs (23 lines):
diff --git a/tools/merovingian/client/monetdb.c
b/tools/merovingian/client/monetdb.c
--- a/tools/merovingian/client/monetdb.c
+++ b/tools/merovingian/client/monetdb.c
@@ -334,12 +334,14 @@ printStatus(sabdb *stats, int mode, int
printf("%-*s %c%c%3s", dbwidth, dbname,
locked ? locked : state, locked ? state : ' ',
uptime);
free(dbname);
- if (uplog.startcntr)
+ if (uplog.startcntr) {
secondsToString(avg, uplog.avguptime, 1);
- printf(" %3d%% %3s %-*s",
- 100 - (uplog.crashcntr * 100 /
uplog.startcntr), avg,
- uriwidth, uri);
- printf("\n");
+ printf(" %3d%% %3s",
+ 100 - (uplog.crashcntr * 100 /
uplog.startcntr), avg);
+ } else {
+ printf(" ");
+ }
+ printf(" %-*s\n", uriwidth, uri);
} else if (mode == 2) {
/* long mode */
char *state;
_______________________________________________
checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list