projects
/
pspp
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
ascii: Don't print command names in output.
[pspp]
/
src
/
output
/
journal.c
diff --git
a/src/output/journal.c
b/src/output/journal.c
index 1a700898ac5e1d6707de700d4b59de1723b32c74..66c1b77534e98118ca7b300bb523d47b1d4b3493 100644
(file)
--- a/
src/output/journal.c
+++ b/
src/output/journal.c
@@
-64,7
+64,7
@@
journal_close (void)
if (journal != NULL && journal->file != NULL)
{
if (fwriteerror (journal->file))
if (journal != NULL && journal->file != NULL)
{
if (fwriteerror (journal->file))
- error (0, errno, _("error writing output file
\"%s\"
"),
+ error (0, errno, _("error writing output file
`%s'
"),
journal_file_name);
journal->file = NULL;
}
journal_file_name);
journal->file = NULL;
}
@@
-90,7
+90,7
@@
journal_output (struct journal_driver *j, const char *s)
j->file = fopen (journal_file_name, "a");
if (j->file == NULL)
{
j->file = fopen (journal_file_name, "a");
if (j->file == NULL)
{
- error (0, errno, _("error opening output file
\"%s\"
"),
+ error (0, errno, _("error opening output file
`%s'
"),
journal_file_name);
output_driver_destroy (&j->driver);
return;
journal_file_name);
output_driver_destroy (&j->driver);
return;
@@
-98,6
+98,11
@@
journal_output (struct journal_driver *j, const char *s)
}
fprintf (j->file, "%s\n", s);
}
fprintf (j->file, "%s\n", s);
+
+ /* Flush the journal in case the syntax we're about to write
+ causes a crash. Having the syntax already written to disk
+ makes postmortem analysis of the problem possible. */
+ fflush (j->file);
}
static void
}
static void