summaryrefslogtreecommitdiff
path: root/libopie/odevice.cpp
Side-by-side diff
Diffstat (limited to 'libopie/odevice.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie/odevice.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp
index 057c344..bf64676 100644
--- a/libopie/odevice.cpp
+++ b/libopie/odevice.cpp
@@ -297,46 +297,48 @@ typedef struct h3600_ts_led {
void ODeviceIPAQ::tstp_sighandler ( int )
{
}
bool ODeviceIPAQ::suspend ( )
{
int fd;
bool res = false;
- if (( fd = ::open ( "/dev/apm_bios", O_RDWR )) >= 0 ) {
+ if ((( fd = ::open ( "/dev/apm_bios", O_RDWR )) >= 0 ) ||
+ (( fd = ::open ( "/dev/misc/apm_bios",O_RDWR )) >= 0 )) {
struct timeval tvs, tvn;
::signal ( SIGTSTP, tstp_sighandler );
::gettimeofday ( &tvs, 0 );
res = ( ::ioctl ( fd, APM_IOC_SUSPEND ) == 0 );
::close ( fd );
if ( res ) {
::kill ( -::getpid ( ), SIGTSTP );
do {
::usleep ( 200 * 1000 );
::gettimeofday ( &tvn, 0 );
} while ((( tvn. tv_sec - tvs. tv_sec ) * 1000 + ( tvn. tv_usec - tvs. tv_usec ) / 1000 ) < 1500 );
::kill ( -::getpid ( ), SIGCONT );
}
::signal ( SIGTSTP, SIG_DFL );
}
+
return res;
}
void ODeviceIPAQ::alarmSound ( )
{
#if defined( QT_QWS_IPAQ ) // IPAQ
#ifndef QT_NO_SOUND
static Sound snd ( "alarm" );
int fd;
int vol;
bool vol_reset = false;