Abfangen von errno, Ausgabe, aber kein Abbruch des Reports.

This commit is contained in:
Enno Rehling 2005-04-25 16:31:36 +00:00
parent 4ed68348ba
commit 20c9112b07
2 changed files with 19 additions and 29 deletions

View File

@ -1104,14 +1104,11 @@ report_computer(FILE * F, faction * f, const faction_list * addresses,
/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */ /* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
/* initialisations, header and lists */ /* initialisations, header and lists */
if (quiet) { fprintf(stdout, "Reports für %s: CR\r", factionname(f));
printf(" CR"); fflush(stdout);
fflush(stdout);
}
else printf(" - schreibe Computerreport\n");
fprintf(F, "VERSION %d\n", C_REPORT_VERSION); fprintf(F, "VERSION %d\n", C_REPORT_VERSION);
fprintf(F, "\"%s\";locale\n", locale_name(f->locale)); fprintf(F, "\"%s\";locale\n", locale_name(f->locale));
fprintf(F, "%d;noskillpoints\n", 1); fprintf(F, "%d;noskillpoints\n", 1);
fprintf(F, "%ld;date\n", report_time); fprintf(F, "%ld;date\n", report_time);
fprintf(F, "\"%s\";Spiel\n", global.gamename); fprintf(F, "\"%s\";Spiel\n", global.gamename);
@ -1525,5 +1522,9 @@ report_computer(FILE * F, faction * f, const faction_list * addresses,
report_crtypes(F, f->locale); report_crtypes(F, f->locale);
write_translations(F); write_translations(F);
reset_translations(); reset_translations();
if (errno) {
log_error(("%s\n", strerror(errno)));
errno = 0;
}
return 0; return 0;
} }

View File

@ -1582,12 +1582,9 @@ order_template(FILE * F, faction * f)
plane *pl; plane *pl;
region *last = f->last?f->last:lastregion(f); region *last = f->last?f->last:lastregion(f);
if (quiet) { fprintf(stdout, "Reports für %s: ZV\r", factionname(f));
printf(" ZV"); fflush(stdout);
fflush(stdout);
}
else
printf(" - Schreibe Zugvorlage\n");
rps_nowrap(F, ""); rps_nowrap(F, "");
rnl(F); rnl(F);
rps_nowrap(F, LOC(f->locale, "nr_template")); rps_nowrap(F, LOC(f->locale, "nr_template"));
@ -2004,16 +2001,12 @@ report(FILE *F, faction * f, const faction_list * addresses,
ix = Pow(O_STATISTICS); ix = Pow(O_STATISTICS);
wants_stats = (f->options & ix); wants_stats = (f->options & ix);
if (quiet) { fprintf(stdout, "Reports für %s: NR\r", factionname(f));
printf(" NR"); fflush(stdout);
fflush(stdout);
}
else
printf(" - Schreibe Report\n");
m = msg_message("nr_header_date", "game date", global.gamename, pzTime); m = msg_message("nr_header_date", "game date", global.gamename, pzTime);
nr_render(m, f->locale, buf, sizeof(buf), f); nr_render(m, f->locale, buf, sizeof(buf), f);
msg_release(m); msg_release(m);
centre(F, buf, true); centre(F, buf, true);
centre(F, gamedate_season(f->locale), true); centre(F, gamedate_season(f->locale), true);
@ -2730,11 +2723,8 @@ reports(void)
current_faction = f; current_faction = f;
gotit = false; gotit = false;
if (quiet) { printf("Reports für %s: \r", factionname(f));
printf("Reports für %s: ", factionname(f)); fflush(stdout);
fflush(stdout);
}
else printf("%s\n", factionname(f));
prepare_report(f); prepare_report(f);
addresses = get_addresses(f); addresses = get_addresses(f);
@ -2886,9 +2876,8 @@ reports(void)
a = a->nexttype; a = a->nexttype;
a_remove(&f->attribs, a_old); a_remove(&f->attribs, a_old);
} }
if (quiet)
printf("\n");
freelist(addresses); freelist(addresses);
putc('\n', stdout);
} }
str = get_param(global.parameters, "globalreport"); str = get_param(global.parameters, "globalreport");