summaryrefslogtreecommitdiffstats
path: root/tdeio/tdeio/slavebase.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-12-04 09:03:25 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2014-12-04 09:03:25 -0600
commite0b1bfb0140e1d484f71683e820731abdd0779d5 (patch)
treecf49f872577733fabde2d5b38c8c045e78dee9eb /tdeio/tdeio/slavebase.cpp
parentd80ccaf94ce31d24834bf3051fb9438adf23e4fd (diff)
downloadtdelibs-e0b1bfb0140e1d484f71683e820731abdd0779d5.tar.gz
tdelibs-e0b1bfb0140e1d484f71683e820731abdd0779d5.zip
Fix a number of build warnings
Diffstat (limited to 'tdeio/tdeio/slavebase.cpp')
-rw-r--r--tdeio/tdeio/slavebase.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/tdeio/tdeio/slavebase.cpp b/tdeio/tdeio/slavebase.cpp
index cb071fc05..aa98c41d3 100644
--- a/tdeio/tdeio/slavebase.cpp
+++ b/tdeio/tdeio/slavebase.cpp
@@ -734,21 +734,25 @@ void SlaveBase::sigsegv_handler(int sig)
// call malloc.. and get in a nice recursive malloc loop
char buffer[120];
snprintf(buffer, sizeof(buffer), "tdeioslave: ####### CRASH ###### protocol = %s pid = %d signal = %d\n", s_protocol, getpid(), sig);
- write(2, buffer, strlen(buffer));
+ if (write(2, buffer, strlen(buffer)) >= 0) {
#ifdef SECURE_DEBUG
kdBacktraceFD();
#else // SECURE_DEBUG
- // Screw the malloc issue! We want nice demangled backtrace!
+ // Screw the malloc issue! We want nice demangled backtraces!
// Anyway we are not supposed to go into infinite loop because next signal
- // will kill us. If you are unlucky and there is a second crash during
- // backtrase in your system, you can define SECURE_DEBUG to avoid it
+ // will kill us. If you are unlucky and there is a second crash during
+ // backtrase in your system, you can define SECURE_DEBUG to avoid it
// Extra sync here so we are sure even if the backtrace will fail
// we will pass at least some crash message.
fsync(2);
TQString backtrace = kdBacktrace();
- write(2, backtrace.ascii(), backtrace.length());
+ if (write(2, backtrace.ascii(), backtrace.length()) < 0) {
+ // FIXME
+ // Could not write crash information
+ }
#endif // SECURE_DEBUG
+ }
::exit(1);
#endif
}