summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiecore/linux/opcmciasystem.cpp12
-rw-r--r--noncore/applets/pcmcia/pcmcia.cpp9
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;
50#define PROC_DEVICES "/proc/devices" 50#define PROC_DEVICES "/proc/devices"
51 51
52#define OPCMCIA_DEBUG 1 52// #define OPCMCIA_DEBUG 1
53 53
54/*====================================================================================== 54/*======================================================================================
@@ -306,5 +306,5 @@ bool OPcmciaSocket::isSuspended() const
306bool OPcmciaSocket::eject() 306bool OPcmciaSocket::eject()
307{ 307{
308 return ::ioctl( _fd, DS_EJECT_CARD ); 308 return ::ioctl( _fd, DS_EJECT_CARD ) != -1;
309} 309}
310 310
@@ -312,5 +312,5 @@ bool OPcmciaSocket::eject()
312bool OPcmciaSocket::insert() 312bool OPcmciaSocket::insert()
313{ 313{
314 return ::ioctl( _fd, DS_INSERT_CARD ); 314 return ::ioctl( _fd, DS_INSERT_CARD ) != -1;
315} 315}
316 316
@@ -318,5 +318,5 @@ bool OPcmciaSocket::insert()
318bool OPcmciaSocket::suspend() 318bool OPcmciaSocket::suspend()
319{ 319{
320 return ::ioctl( _fd, DS_SUSPEND_CARD ); 320 return ::ioctl( _fd, DS_SUSPEND_CARD ) != -1;
321} 321}
322 322
@@ -324,5 +324,5 @@ bool OPcmciaSocket::suspend()
324bool OPcmciaSocket::resume() 324bool OPcmciaSocket::resume()
325{ 325{
326 return ::ioctl( _fd, DS_RESUME_CARD ); 326 return ::ioctl( _fd, DS_RESUME_CARD ) != -1;
327} 327}
328 328
@@ -330,5 +330,5 @@ bool OPcmciaSocket::resume()
330bool OPcmciaSocket::reset() 330bool OPcmciaSocket::reset()
331{ 331{
332 return ::ioctl( _fd, DS_RESET_CARD ); 332 return ::ioctl( _fd, DS_RESET_CARD ) != -1;
333} 333}
334 334
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;
58#include <stdlib.h> 58#include <stdlib.h>
59#include <string.h> 59#include <string.h>
60#include <errno.h>
60#include <fcntl.h> 61#include <fcntl.h>
61#if defined(_OS_LINUX_) || defined(Q_OS_LINUX) 62#if defined(_OS_LINUX_) || defined(Q_OS_LINUX)
@@ -137,6 +138,6 @@ void PcmciaManager::mousePressEvent( QMouseEvent* )
137 submenu->setItemEnabled( EJECT+i*100, !it.current()->isEmpty() ); 138 submenu->setItemEnabled( EJECT+i*100, !it.current()->isEmpty() );
138 submenu->setItemEnabled( INSERT+i*100, it.current()->isEmpty() ); 139 submenu->setItemEnabled( INSERT+i*100, it.current()->isEmpty() );
139 submenu->setItemEnabled( SUSPEND+i*100, !it.current()->isEmpty() && !it.current()->isSuspended() ); 140 submenu->setItemEnabled( SUSPEND+i*100, !it.current()->isEmpty() && it.current()->isSuspended() );
140 submenu->setItemEnabled( RESUME+i*100, !it.current()->isEmpty() && it.current()->isSuspended() ); 141 submenu->setItemEnabled( RESUME+i*100, !it.current()->isEmpty() && !it.current()->isSuspended() );
141 submenu->setItemEnabled( CONFIGURE+i*100, !it.current()->isEmpty() && !configuring ); 142 submenu->setItemEnabled( CONFIGURE+i*100, !it.current()->isEmpty() && !configuring );
142 143
@@ -260,5 +261,5 @@ void PcmciaManager::execCommand( const QStringList &strList )
260void PcmciaManager::userCardAction( int action ) 261void PcmciaManager::userCardAction( int action )
261{ 262{
262 odebug << "user action requested. action = " << action << oendl; 263 odebug << "user action on socket " << action / 100 << " requested. action = " << action << oendl;
263 264
264 int socket = action / 100; 265 int socket = action / 100;
@@ -279,5 +280,5 @@ void PcmciaManager::userCardAction( int action )
279 if ( !success ) 280 if ( !success )
280 { 281 {
281 owarn << "couldn't perform user action" << oendl; 282 owarn << "couldn't perform user action (" << strerror( errno ) << ")" << oendl;
282 } 283 }
283 284