# include <signal.h>
#endif
+#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
# include <console.h> // -dw- for command line dialog
#endif
+char *homedir = ::getenv( "HOME" );
+char *hostname = ::getenv( "HOSTNAME" );
+bool free_hostname = false;
+
// foreward declaration.
void fgExitCleanup();
// We must use cerr rather than
// logging, since logging may be
// disabled.
- cerr << "Fatal error: " << t.getFormattedMessage()
- << "\n (received from " << t.getOrigin() << ')' << endl;
+ cerr << "Fatal error: " << t.getFormattedMessage() << endl;
+ if (!t.getOrigin().empty())
+ cerr << " (received from " << t.getOrigin() << ')' << endl;
+
} catch (...) {
cerr << "Unknown exception in the main loop. Aborting..." << endl;
- perror("Possible cause");
+ if (errno)
+ perror("Possible cause");
}
return 0;
fgSetMouseCursor(MOUSE_CURSOR_POINTER);
delete globals;
+
+ if (free_hostname && hostname != NULL)
+ free(hostname);
}