Use the msg function to report errors wherever possible.
authorJohn Darrington <john@darrington.wattle.id.au>
Mon, 23 Sep 2013 14:46:53 +0000 (16:46 +0200)
committerJohn Darrington <john@darrington.wattle.id.au>
Wed, 25 Sep 2013 06:00:07 +0000 (08:00 +0200)
commitfce028c380d496e42823fd24774e0159ed7cc110
tree0f79fc4f668d093c333df9df5032a1dc483b13c7
parent6d0d055e9336d05a3efca53d551eb905bd956e72
Use the msg function to report errors wherever possible.

Previously, some errors were reported using the GNU "error" function from error.h
rather than the PSPP msg function.  This wasn't too bad for the terminal user interace,
but gui users could miss important messages (since they never see stderr).

The reason for not using msg in some instances, was twofold: 1) Some
errors might occur before the messaging system had been initialised. 2) If an
error occured whilst reporting an error, an infinite loop would occur.

This change overcomes these problems by detecting re-entrancy, and uninitialised
messaging system, and falling back to fwrite if either of these conditions occur.
30 files changed:
src/data/case-tmpfile.c
src/data/settings.c
src/libpspp/ext-array.c
src/libpspp/float-format.c
src/libpspp/message.c
src/libpspp/message.h
src/libpspp/zip-writer.c
src/output/ascii.c
src/output/cairo-chart.c
src/output/cairo.c
src/output/csv.c
src/output/driver.c
src/output/html.c
src/output/journal.c
src/output/measure.c
src/output/msglog.c
src/output/odt.c
src/output/options.c
src/output/tab.c
src/ui/gui/page-assistant.c
src/ui/gui/page-file.c
src/ui/gui/page-first-line.c
src/ui/gui/page-formats.c
src/ui/gui/page-intro.c
src/ui/gui/page-separators.c
src/ui/gui/page-sheet-spec.c
src/ui/gui/psppire-output-window.c
src/ui/gui/text-data-import-dialog.c
tests/automake.mk
tests/output/output.at