CVS commit by ravi: Extend Zack's commit to allow logging on multiple machines with an NFS mounted HOME. M +10 -1 dcopserver.cpp 1.165 --- kdelibs/dcop/dcopserver.cpp #1.164:1.165 @@ -46,9 +46,14 @@ CONNECTION WITH THE SOFTWARE OR THE USE #include #endif +#ifdef DCOP_LOG +#include +#endif #define QT_CLEAN_NAMESPACE 1 #include #include +#ifdef DCOP_LOG #include +#endif DCOP_LOG #include #include @@ -1043,5 +1048,9 @@ DCOPServer::DCOPServer(bool _suicide) #ifdef DCOP_LOG - m_logger = new QFile( QString( "%1/.dcop.log" ).arg( QDir::homeDirPath() ) ); + char hostname_buffer[256]; + memset( hostname_buffer, 0, sizeof( hostname_buffer ) ); + if ( gethostname( hostname_buffer, 255 ) < 0 ) + hostname_buffer[0] = '\0'; + m_logger = new QFile( QString( "%1/.dcop-%2.log" ).arg( QDir::homeDirPath() ).arg( hostname_buffer ) ); if ( m_logger->open( IO_WriteOnly ) ) { m_stream = new QTextStream( m_logger );