Code cleanup

This commit is contained in:
Michiel Broek 2005-08-19 19:07:24 +00:00
parent 5705cb1538
commit d224ff61eb
4 changed files with 52 additions and 57 deletions

View File

@ -2,6 +2,12 @@ $Id$
v0.71.5 18-Aug-2005 v0.71.5 18-Aug-2005
mbfido:
Removed debug logging for solved crash.
mbdiff:
Code cleanup.
v0.71.4 12-Aug-2005 - 18-Aug-2005 v0.71.4 12-Aug-2005 - 18-Aug-2005

View File

@ -5,7 +5,7 @@
* Original ideas ........: Eugene G. Crosser. * Original ideas ........: Eugene G. Crosser.
* *
***************************************************************************** *****************************************************************************
* Copyright (C) 1997-2004 * Copyright (C) 1997-2005
* *
* Michiel Broek FIDO: 2:280/2802 * Michiel Broek FIDO: 2:280/2802
* Beekmansbos 10 * Beekmansbos 10
@ -252,9 +252,9 @@ int main(int argc, char **argv)
*/ */
if ((arc = unpacker(nd)) == NULL) { if ((arc = unpacker(nd)) == NULL) {
show_log = TRUE; show_log = TRUE;
WriteError("Can't get filetype for %s", nd);
free(onl); free(onl);
free(wrk); free(wrk);
WriteError("Can't get filetype for %s", nd);
die(MBERR_CONFIG_ERROR); die(MBERR_CONFIG_ERROR);
} }
@ -289,10 +289,6 @@ int main(int argc, char **argv)
die(MBERR_CONFIG_ERROR); die(MBERR_CONFIG_ERROR);
} }
if (execute_str(cmd, nd, (char *)NULL, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null")) {
WriteError("Warning: unpack error, trying again after a sync");
sync();
sleep(1);
if (execute_str(cmd, nd, (char *)NULL, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null")) { if (execute_str(cmd, nd, (char *)NULL, (char *)"/dev/null", (char *)"/dev/null", (char *)"/dev/null")) {
show_log = TRUE; show_log = TRUE;
free(cmd); free(cmd);
@ -302,7 +298,6 @@ int main(int argc, char **argv)
WriteError("Fatal: unpack error"); WriteError("Fatal: unpack error");
die(MBERR_EXEC_FAILED); die(MBERR_EXEC_FAILED);
} }
}
free(cmd); free(cmd);
Match = FALSE; Match = FALSE;
@ -339,7 +334,6 @@ int main(int argc, char **argv)
WriteError("Copy %s failed, %s", nd, strerror(rc)); WriteError("Copy %s failed, %s", nd, strerror(rc));
die(MBERR_DIFF_ERROR); die(MBERR_DIFF_ERROR);
} }
Syslog('s', "Copied %s", nd);
} }
if (((p = strrchr(onl, '.'))) && ((q = strrchr(ond, '.'))) && (strlen(p) == strlen(q))) { if (((p = strrchr(onl, '.'))) && ((q = strrchr(ond, '.'))) && (strlen(p) == strlen(q))) {

View File

@ -610,7 +610,7 @@ int ProcessTic(fa_list **sbl)
sprintf(temp1, "%s/%s", TIC.Inbound, TIC.NewFile); sprintf(temp1, "%s/%s", TIC.Inbound, TIC.NewFile);
sprintf(Temp, "%s/etc/%s", getenv("MBSE_ROOT"), tic.Banner); sprintf(Temp, "%s/etc/%s", getenv("MBSE_ROOT"), tic.Banner);
if (execute_str(cmd, temp1, (char *)NULL, Temp, (char *)"/dev/null", (char *)"/dev/null")) { if (execute_str(cmd, temp1, (char *)NULL, Temp, (char *)"/dev/null", (char *)"/dev/null")) {
WriteError("$Changing the banner failed"); WriteError("Changing the banner failed");
} else { } else {
Syslog('+', "New banner %s", tic.Banner); Syslog('+', "New banner %s", tic.Banner);
TIC.FileSize = file_size(temp1); TIC.FileSize = file_size(temp1);
@ -717,8 +717,6 @@ int ProcessTic(fa_list **sbl)
if (tmpq->send) { if (tmpq->send) {
sprintf(sbe, "%u:%u/%u", tmpq->aka.zone, tmpq->aka.net, tmpq->aka.node); sprintf(sbe, "%u:%u/%u", tmpq->aka.zone, tmpq->aka.net, tmpq->aka.node);
fill_list(sbl, sbe, NULL); fill_list(sbl, sbe, NULL);
} else {
Syslog('f', "Skip SB %u:%u/%u", tmpq->aka.zone, tmpq->aka.net, tmpq->aka.node);
} }
} }
uniq_list(sbl); uniq_list(sbl);
@ -746,7 +744,6 @@ int ProcessTic(fa_list **sbl)
free(Temp); free(Temp);
tidy_qualify(&qal); tidy_qualify(&qal);
Syslog('f', "ProcessTic: post processing end");
return 0; return 0;
} }

View File

@ -484,9 +484,7 @@ int LoadTic(char *inb, char *tfn)
tic_in++; tic_in++;
rc = ProcessTic(&sbl); rc = ProcessTic(&sbl);
Syslog('f', "back from ProcessTic");
tidy_falist(&sbl); tidy_falist(&sbl);
Syslog('f', "tidy_falist(&sbl) done");
return rc; return rc;
} }