Better mbtask logging

This commit is contained in:
Michiel Broek 2003-08-03 15:58:26 +00:00
parent 893f84ebc5
commit a14e540cd4
4 changed files with 68 additions and 60 deletions

View File

@ -33,6 +33,7 @@ v0.37.5 12-Jul-2003
Now uses standard locking in ~/var/run Now uses standard locking in ~/var/run
When idle, it now reports the time to the next event to be When idle, it now reports the time to the next event to be
seen in mbmon menu 1. seen in mbmon menu 1.
Remove some semafore debug messages.
mbmon: mbmon:
Added program locking, only one mbmon can run at the same time Added program locking, only one mbmon can run at the same time

View File

@ -600,10 +600,11 @@ int checktasks(int onsig)
Syslog('+', "Task %s is ready", task[i].name); Syslog('+', "Task %s is ready", task[i].name);
} else if (WIFSIGNALED(task[i].status)) { } else if (WIFSIGNALED(task[i].status)) {
rc = WTERMSIG(task[i].status); rc = WTERMSIG(task[i].status);
if (rc <= 31) /*
Syslog('+', "Task %s terminated on signal %s (%d)", task[i].name, SigName[rc], rc); * Here we don't report an error number, on FreeBSD WIFSIGNALED
else * seems true while there's nothing wrong.
Syslog('+', "Task %s terminated with error nr %d", task[i].name, rc); */
Syslog('+', "Task %s terminated", task[i].name);
} else if (WIFSTOPPED(task[i].status)) { } else if (WIFSTOPPED(task[i].status)) {
rc = WSTOPSIG(task[i].status); rc = WSTOPSIG(task[i].status);
Syslog('+', "Task %s stopped on signal %s (%d)", task[i].name, SigName[rc], rc); Syslog('+', "Task %s stopped on signal %s (%d)", task[i].name, SigName[rc], rc);

View File

@ -113,7 +113,7 @@ void load_ports()
FILE *fp; FILE *fp;
pp_list new; pp_list new;
int stdflag; int stdflag;
char *p, *q; char *p, *q, *capflags;
nodelist_modem **tmpm; nodelist_modem **tmpm;
tidy_portlist(&pl); tidy_portlist(&pl);
@ -136,6 +136,7 @@ void load_ports()
memset(&new, 0, sizeof(new)); memset(&new, 0, sizeof(new));
strncpy(new.tty, ttyinfo.tty, 6); strncpy(new.tty, ttyinfo.tty, 6);
capflags = xstrcpy((char *)"flags:");
stdflag = TRUE; stdflag = TRUE;
q = xstrcpy(ttyinfo.flags); q = xstrcpy(ttyinfo.flags);
for (p = q; p; p = q) { for (p = q; p; p = q) {
@ -145,16 +146,24 @@ void load_ports()
stdflag = FALSE; stdflag = FALSE;
} else { } else {
for (tmpm = &nl_pots; *tmpm; tmpm=&((*tmpm)->next)) for (tmpm = &nl_pots; *tmpm; tmpm=&((*tmpm)->next))
if (strcasecmp(p, (*tmpm)->name) == 0) if (strcasecmp(p, (*tmpm)->name) == 0) {
new.mflags |= (*tmpm)->value; new.mflags |= (*tmpm)->value;
capflags = xstrcat(capflags, (char *)" ");
capflags = xstrcat(capflags, (*tmpm)->name);
}
for (tmpm = &nl_isdn; *tmpm; tmpm=&((*tmpm)->next)) for (tmpm = &nl_isdn; *tmpm; tmpm=&((*tmpm)->next))
if (strcasecmp(p, (*tmpm)->name) == 0) if (strcasecmp(p, (*tmpm)->name) == 0) {
new.dflags |= (*tmpm)->value; new.dflags |= (*tmpm)->value;
capflags = xstrcat(capflags, (char *)" ");
capflags = xstrcat(capflags, (*tmpm)->name);
}
} }
} }
Syslog('p', "port %s modem %08lx ISDN %08lx", new.tty, new.mflags, new.dflags); Syslog('+', "Found line %s, %s", new.tty, capflags);
fill_portlist(&pl, &new); fill_portlist(&pl, &new);
if (capflags)
free(capflags);
} }
} }

View File

@ -340,8 +340,6 @@ char *getseq(void)
int sem_set(char *sem, int value) int sem_set(char *sem, int value)
{ {
Syslog('s', "%s semafore \"%s\"", value?"Set":"Clear", sem);
if (!strcmp(sem, "scanout")) { if (!strcmp(sem, "scanout")) {
s_scanout = value; s_scanout = value;
if (value) if (value)
@ -406,7 +404,6 @@ char *sem_status(char *data)
} }
sprintf(buf, "100:1,%s;", value ? "1":"0"); sprintf(buf, "100:1,%s;", value ? "1":"0");
Syslog('s', "Check semafore \"%s\": %s present", sem, value?"is":"not");
return buf; return buf;
} }