Changeset: 2ea938bafd98 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2ea938bafd98
Modified Files:
common/utils/msabaoth.c
tools/merovingian/client/monetdb.c
Branch: Nov2019
Log Message:
Fixed wording of status information after crash.
This fixes bug 6796.
diffs (67 lines):
diff --git a/common/utils/msabaoth.c b/common/utils/msabaoth.c
--- a/common/utils/msabaoth.c
+++ b/common/utils/msabaoth.c
@@ -848,8 +848,7 @@ msab_getUplogInfo(sabuplog *ret, const s
start = stop = up = 0;
p = data;
while ((c = getc(f)) != EOF) {
- *p = (char)c;
- switch (*p) {
+ switch (c) {
case '\t':
/* start attempt */
ret->startcntr++;
@@ -879,7 +878,7 @@ msab_getUplogInfo(sabuplog *ret, const s
break;
default:
/* timestamp */
- p++;
+ *p++ = c;
break;
}
}
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
@@ -282,7 +282,7 @@ printStatus(sabdb *stats, int mode, int
char locked = '\0';
char uptime[12];
char avg[8];
- char info[32];
+ char info[64];
char *dbname;
char *uri;
@@ -318,7 +318,7 @@ printStatus(sabdb *stats, int mode, int
{
struct tm *t;
t = localtime(&uplog.lastcrash);
- strftime(info, sizeof(info), "crashed on %Y-%m-%d
%H:%M:%S", t);
+ strftime(info, sizeof(info), "crashed (started on
%Y-%m-%d %H:%M:%S)", t);
}
switch (stats->state) {
@@ -461,7 +461,7 @@ printStatus(sabdb *stats, int mode, int
break;
case SABdbCrashed:
t = localtime(&uplog.lastcrash);
- strftime(buf, sizeof(buf), "crashed on %Y-%m-%d
%H:%M:%S", t);
+ strftime(buf, sizeof(buf), "crashed (started on
%Y-%m-%d %H:%M:%S)", t);
break;
case SABdbInactive:
snprintf(buf, sizeof(buf), "not running");
@@ -807,13 +807,12 @@ command_status(int argc, char *argv[])
int len = 0;
/* calculate dbwidth and uriwidth */
+ uriwidth = 32;
for (stats = orig; stats != NULL; stats = stats->next) {
if ((t = strlen(stats->dbname)) > dbwidth)
dbwidth = t;
if (stats->uri != NULL && (t = strlen(stats->uri)) >
uriwidth)
uriwidth = t;
- if (uriwidth < 32)
- uriwidth = 32;
}
/* Ultra Condensed State(tm) since Feb2013:
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list