From e0b1bfb0140e1d484f71683e820731abdd0779d5 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 4 Dec 2014 09:03:25 -0600 Subject: Fix a number of build warnings --- tdeio/tdeio/forwardingslavebase.cpp | 2 -- tdeio/tdeio/job.cpp | 4 ++-- tdeio/tdeio/kzip.cpp | 4 ++-- tdeio/tdeio/slavebase.cpp | 14 +++++++++----- tdeio/tdeio/slaveinterface.cpp | 10 +++++++--- 5 files changed, 20 insertions(+), 14 deletions(-) (limited to 'tdeio/tdeio') diff --git a/tdeio/tdeio/forwardingslavebase.cpp b/tdeio/tdeio/forwardingslavebase.cpp index e86aaef88..c4e4daa0c 100644 --- a/tdeio/tdeio/forwardingslavebase.cpp +++ b/tdeio/tdeio/forwardingslavebase.cpp @@ -69,7 +69,6 @@ void ForwardingSlaveBase::prepareUDSEntry(TDEIO::UDSEntry &entry, kdDebug() << "ForwardingSlaveBase::prepareUDSEntry: listing==" << listing << endl; - bool url_found = false; TQString name; KURL url; @@ -87,7 +86,6 @@ void ForwardingSlaveBase::prepareUDSEntry(TDEIO::UDSEntry &entry, kdDebug() << "Name = " << name << endl; break; case TDEIO::UDS_URL: - url_found = true; url = (*it).m_str; if (listing) { diff --git a/tdeio/tdeio/job.cpp b/tdeio/tdeio/job.cpp index 250d3d34e..f6156a966 100644 --- a/tdeio/tdeio/job.cpp +++ b/tdeio/tdeio/job.cpp @@ -4308,7 +4308,7 @@ void DeleteJob::slotResult( Job *job ) UDSEntry entry = ((StatJob*)job)->statResult(); bool bDir = false; bool bLink = false; - TDEIO::filesize_t size = (TDEIO::filesize_t)-1; +// TDEIO::filesize_t size = (TDEIO::filesize_t)-1; UDSEntry::ConstIterator it2 = entry.begin(); int atomsFound(0); for( ; it2 != entry.end(); it2++ ) @@ -4325,7 +4325,7 @@ void DeleteJob::slotResult( Job *job ) } else if ( ((*it2).m_uds) == UDS_SIZE ) { - size = (*it2).m_long; +// size = (*it2).m_long; atomsFound++; } if (atomsFound==3) break; diff --git a/tdeio/tdeio/kzip.cpp b/tdeio/tdeio/kzip.cpp index 91f36a085..bafb174eb 100644 --- a/tdeio/tdeio/kzip.cpp +++ b/tdeio/tdeio/kzip.cpp @@ -627,9 +627,9 @@ kdDebug(7040) << "dev->at() now : " << dev->at() << endl; else { // kdDebug(7040) << "before interesting dev->at(): " << dev->at() << endl; - bool success; +/* bool success; success = dev->at( dev->at() + compr_size ); // can this fail ??? -/* kdDebug(7040) << "after interesting dev->at(): " << dev->at() << endl; + kdDebug(7040) << "after interesting dev->at(): " << dev->at() << endl; if ( success ) kdDebug(7040) << "dev->at was successful... " << endl; else 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 } diff --git a/tdeio/tdeio/slaveinterface.cpp b/tdeio/tdeio/slaveinterface.cpp index 6de70b57f..47f935cda 100644 --- a/tdeio/tdeio/slaveinterface.cpp +++ b/tdeio/tdeio/slaveinterface.cpp @@ -533,11 +533,15 @@ void SlaveInterface::sigpipe_handler(int) { int saved_errno = errno; // Using kdDebug from a signal handler is not a good idea. -#ifndef NDEBUG +#ifndef NDEBUG char msg[1000]; sprintf(msg, "*** SIGPIPE *** (ignored, pid = %ld)\n", (long) getpid()); - write(2, msg, strlen(msg)); -#endif + if (write(2, msg, strlen(msg)) < 0) { + // FIXME + // Could not write error message + // Triple fault? ;-) + } +#endif // Do nothing. // dispatch will return false and that will trigger ERR_SLAVE_DIED in slave.cpp -- cgit v1.2.3