From 4d2d58662cca3fcd12bea15482dd13359bc208ad Mon Sep 17 00:00:00 2001 From: Felix Domke Date: Thu, 6 Apr 2006 09:26:53 +0000 Subject: [PATCH] add some CVS information into crashlog --- main/Makefile.am | 14 ++++++++++++++ main/bsod.cpp | 12 ++++++++++++ 2 files changed, 26 insertions(+) diff --git a/main/Makefile.am b/main/Makefile.am index 636c6ffa..abc71cdd 100644 --- a/main/Makefile.am +++ b/main/Makefile.am @@ -6,6 +6,20 @@ bin_PROGRAMS = enigma2 enigma2_SOURCES = \ enigma.cpp bsod.cpp +bsod.o: version.h + +# when there is no ../CVS/Entries, don't worry. +../CVS/Entries: + +../CVS/Root: + +# this depends on Entries and not on Tag because Tag isn't always there. +# Entries, however, will change then Tag is changed, so everything is fine. +version.h: ../CVS/Entries ../CVS/Root + > version.h + if [ -f ../CVS/Tag ]; then echo "#define ENIGMA2_CHECKOUT_TAG \"`cat ../CVS/Tag`\"" >> version.h; fi + if [ -f ../CVS/Root ]; then echo "#define ENIGMA2_CHECKOUT_ROOT \"`cat ../CVS/Root`\"" >> version.h; fi + enigma2_LDADD_WHOLE = \ $(top_builddir)/lib/actions/libenigma_actions.a \ $(top_builddir)/lib/base/libenigma_base.a \ diff --git a/main/bsod.cpp b/main/bsod.cpp index dd274eca..10021787 100644 --- a/main/bsod.cpp +++ b/main/bsod.cpp @@ -7,6 +7,8 @@ #include #include +#include "version.h" + /************************************************/ #define CRASH_EMAILADDR "crashlog@dream-multimedia-tv.de" @@ -72,6 +74,14 @@ void bsodFatal() { time_t t = time(0); fprintf(f, "enigma2 crashed on %s", ctime(&t)); +#ifdef ENIGMA2_CHECKOUT_TAG + fprintf(f, "enigma2 CVS TAG: " ENIGMA2_CHECKOUT_TAG "\n"); +#else + fprintf(f, "enigma2 compiled on " __DATE__ "\n"); +#endif +#ifdef ENIGMA2_CHECKOUT_ROOT + fprintf(f, "enigma2 checked out from " ENIGMA2_CHECKOUT_ROOT "\n"); +#endif fprintf(f, "please email this file to " CRASH_EMAILADDR "\n"); std::string buffer = getLogBuffer(); fwrite(buffer.c_str(), buffer.size(), 1, f); @@ -83,6 +93,7 @@ void bsodFatal() { gPainter p(my_dc); + p.resetOffset(); p.resetClip(eRect(ePoint(0, 0), my_dc->size())); p.setBackgroundColor(gRGB(0x0000C0)); p.setForegroundColor(gRGB(0xFFFFFF)); @@ -120,6 +131,7 @@ void bsodFatal() p.renderText(usable_area, lines.substr(start), gPainter::RT_HALIGN_LEFT); + p.flush(); } raise(SIGKILL); -- 2.30.2