Diffstat (limited to 'libopie2/opiecore/linux/opcmciasystem.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiecore/linux/opcmciasystem.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libopie2/opiecore/linux/opcmciasystem.cpp b/libopie2/opiecore/linux/opcmciasystem.cpp index 445d903..2b0c01d 100644 --- a/libopie2/opiecore/linux/opcmciasystem.cpp +++ b/libopie2/opiecore/linux/opcmciasystem.cpp @@ -185,52 +185,54 @@ OPcmciaSocket::~OPcmciaSocket() cleanup(); } /* internal */ void OPcmciaSocket::init() { // open control socket and gather file descriptor if ( _major ) { dev_t dev = makedev( _major, _socket ); #ifdef OPCMCIA_DEBUG QString filename = "/tmp/opcmciasystem-debug"; if ( QFile::exists( filename ) ) #else QString filename = QString().sprintf( "/tmp/opcmciasystem-%d", ::getpid() ); if ( ::mknod( (const char*) filename, ( S_IFCHR|S_IREAD|S_IWRITE ), dev ) == 0 ) #endif { _fd = ::open( (const char*) filename, O_RDONLY); if ( !_fd ) { qWarning( "OPcmciaSocket::init() - can't open control socket (%s)", strerror( errno ) ); } +#ifndef OPCMCIA_DEBUG else { ::unlink( (const char*) filename ); } +#endif } else { qWarning( "OPcmciaSocket::init() - can't create device node '%s' (%s)", (const char*) filename, strerror( errno ) ); } } } /* internal */ void OPcmciaSocket::cleanup() { // close control socket } /* internal */ bool OPcmciaSocket::getTuple( cisdata_t tuple ) const { _ioctlarg.tuple.DesiredTuple = tuple; _ioctlarg.tuple.Attributes = TUPLE_RETURN_COMMON; _ioctlarg.tuple.TupleOffset = 0; int result; result = ::ioctl(_fd, DS_GET_FIRST_TUPLE, &_ioctlarg); if ( result != 0 ) { qWarning( "OPcmciaSocket::getTuple() - DS_GET_FIRST_TUPLE failed (%s)", strerror( errno ) ); |