-rw-r--r-- | libopie2/opiecore/linux/opcmciasystem.cpp | 12 | ||||
-rw-r--r-- | noncore/applets/pcmcia/pcmcia.cpp | 9 |
2 files changed, 11 insertions, 10 deletions
diff --git a/libopie2/opiecore/linux/opcmciasystem.cpp b/libopie2/opiecore/linux/opcmciasystem.cpp index 2eece6b..054d261 100644 --- a/libopie2/opiecore/linux/opcmciasystem.cpp +++ b/libopie2/opiecore/linux/opcmciasystem.cpp @@ -50,5 +50,5 @@ using namespace Opie::Core; #define PROC_DEVICES "/proc/devices" -#define OPCMCIA_DEBUG 1 +// #define OPCMCIA_DEBUG 1 /*====================================================================================== @@ -306,5 +306,5 @@ bool OPcmciaSocket::isSuspended() const bool OPcmciaSocket::eject() { - return ::ioctl( _fd, DS_EJECT_CARD ); + return ::ioctl( _fd, DS_EJECT_CARD ) != -1; } @@ -312,5 +312,5 @@ bool OPcmciaSocket::eject() bool OPcmciaSocket::insert() { - return ::ioctl( _fd, DS_INSERT_CARD ); + return ::ioctl( _fd, DS_INSERT_CARD ) != -1; } @@ -318,5 +318,5 @@ bool OPcmciaSocket::insert() bool OPcmciaSocket::suspend() { - return ::ioctl( _fd, DS_SUSPEND_CARD ); + return ::ioctl( _fd, DS_SUSPEND_CARD ) != -1; } @@ -324,5 +324,5 @@ bool OPcmciaSocket::suspend() bool OPcmciaSocket::resume() { - return ::ioctl( _fd, DS_RESUME_CARD ); + return ::ioctl( _fd, DS_RESUME_CARD ) != -1; } @@ -330,5 +330,5 @@ bool OPcmciaSocket::resume() bool OPcmciaSocket::reset() { - return ::ioctl( _fd, DS_RESET_CARD ); + return ::ioctl( _fd, DS_RESET_CARD ) != -1; } diff --git a/noncore/applets/pcmcia/pcmcia.cpp b/noncore/applets/pcmcia/pcmcia.cpp index aea699f..99c1bc9 100644 --- a/noncore/applets/pcmcia/pcmcia.cpp +++ b/noncore/applets/pcmcia/pcmcia.cpp @@ -58,4 +58,5 @@ using namespace Opie::Ui; #include <stdlib.h> #include <string.h> +#include <errno.h> #include <fcntl.h> #if defined(_OS_LINUX_) || defined(Q_OS_LINUX) @@ -137,6 +138,6 @@ void PcmciaManager::mousePressEvent( QMouseEvent* ) submenu->setItemEnabled( EJECT+i*100, !it.current()->isEmpty() ); submenu->setItemEnabled( INSERT+i*100, it.current()->isEmpty() ); - submenu->setItemEnabled( SUSPEND+i*100, !it.current()->isEmpty() && !it.current()->isSuspended() ); - submenu->setItemEnabled( RESUME+i*100, !it.current()->isEmpty() && it.current()->isSuspended() ); + submenu->setItemEnabled( SUSPEND+i*100, !it.current()->isEmpty() && it.current()->isSuspended() ); + submenu->setItemEnabled( RESUME+i*100, !it.current()->isEmpty() && !it.current()->isSuspended() ); submenu->setItemEnabled( CONFIGURE+i*100, !it.current()->isEmpty() && !configuring ); @@ -260,5 +261,5 @@ void PcmciaManager::execCommand( const QStringList &strList ) void PcmciaManager::userCardAction( int action ) { - odebug << "user action requested. action = " << action << oendl; + odebug << "user action on socket " << action / 100 << " requested. action = " << action << oendl; int socket = action / 100; @@ -279,5 +280,5 @@ void PcmciaManager::userCardAction( int action ) if ( !success ) { - owarn << "couldn't perform user action" << oendl; + owarn << "couldn't perform user action (" << strerror( errno ) << ")" << oendl; } |