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 */
if (quiet) {
printf(" CR");
fflush(stdout);
}
else printf(" - schreibe Computerreport\n");
fprintf(stdout, "Reports für %s: CR\r", factionname(f));
fflush(stdout);
fprintf(F, "VERSION %d\n", C_REPORT_VERSION);
fprintf(F, "\"%s\";locale\n", locale_name(f->locale));
fprintf(F, "VERSION %d\n", C_REPORT_VERSION);
fprintf(F, "\"%s\";locale\n", locale_name(f->locale));
fprintf(F, "%d;noskillpoints\n", 1);
fprintf(F, "%ld;date\n", report_time);
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);
write_translations(F);
reset_translations();
if (errno) {
log_error(("%s\n", strerror(errno)));
errno = 0;
}
return 0;
}

View File

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