author | erik <erik> | 2007-02-09 21:12:35 (UTC) |
---|---|---|
committer | erik <erik> | 2007-02-09 21:12:35 (UTC) |
commit | 2695f72652956e94e24611539579e7ff7899811e (patch) (unidiff) | |
tree | 0a2e73775f5b04da5950465f1c31e067256a266c /libopie2 | |
parent | 9abe862308081155837512dd5e6c581752c9ddb2 (diff) | |
download | opie-2695f72652956e94e24611539579e7ff7899811e.zip opie-2695f72652956e94e24611539579e7ff7899811e.tar.gz opie-2695f72652956e94e24611539579e7ff7899811e.tar.bz2 |
This commit fixes an issue where an ioctl call is made but the return
value is not checked. It isn't a big deal. But it would be nice if the
user knew that an ioctl to a device tanked.
-rw-r--r-- | libopie2/opiecore/device/odevice.cpp | 7 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_htc.cpp | 4 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.cpp | 4 |
3 files changed, 12 insertions, 3 deletions
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp index e4233eb..aecccca 100644 --- a/libopie2/opiecore/device/odevice.cpp +++ b/libopie2/opiecore/device/odevice.cpp | |||
@@ -68,2 +68,3 @@ | |||
68 | #include <linux/soundcard.h> | 68 | #include <linux/soundcard.h> |
69 | #include <errno.h> | ||
69 | #endif | 70 | #endif |
@@ -751,2 +752,4 @@ void ODevice::remPreHandler(QWSServer::KeyboardFilter*aFilter) | |||
751 | * | 752 | * |
753 | * Returns the volume back to the user preference after an alarm is finished. | ||
754 | * | ||
752 | * @see changeMixerForAlarm | 755 | * @see changeMixerForAlarm |
@@ -759,3 +762,5 @@ void ODevice::playingStopped() { | |||
759 | if ( d->m_sound >= 0 ) { | 762 | if ( d->m_sound >= 0 ) { |
760 | ::ioctl ( d->m_sound, MIXER_WRITE( d->m_mixer ), &d->m_vol ); | 763 | if (::ioctl ( d->m_sound, MIXER_WRITE( d->m_mixer ), &d->m_vol ) == -1) |
764 | qWarning( "ODevice::playingStopped() - " | ||
765 | "unable to change volume back (%s)", strerror( errno ) ); | ||
761 | ::close ( d->m_sound ); | 766 | ::close ( d->m_sound ); |
diff --git a/libopie2/opiecore/device/odevice_htc.cpp b/libopie2/opiecore/device/odevice_htc.cpp index 44b33c0..7f82369 100644 --- a/libopie2/opiecore/device/odevice_htc.cpp +++ b/libopie2/opiecore/device/odevice_htc.cpp | |||
@@ -308,3 +308,5 @@ void HTC::buzzer( int sound ) | |||
308 | if ( fd >= 0 ) { | 308 | if ( fd >= 0 ) { |
309 | ::ioctl ( fd, SHARP_BUZZER_MAKESOUND, sound ); | 309 | if (::ioctl ( fd, SHARP_BUZZER_MAKESOUND, sound ) == -1) |
310 | qWarning( "HTC::buzzer() - Couldn't make the buzzer buzz (%s)", | ||
311 | strerror( errno ) ); | ||
310 | ::close ( fd ); | 312 | ::close ( fd ); |
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp index 9d2ebbb..f978355 100644 --- a/libopie2/opiecore/device/odevice_zaurus.cpp +++ b/libopie2/opiecore/device/odevice_zaurus.cpp | |||
@@ -382,3 +382,5 @@ void Zaurus::buzzer( int sound ) | |||
382 | if ( fd >= 0 ) { | 382 | if ( fd >= 0 ) { |
383 | ::ioctl ( fd, SHARP_BUZZER_MAKESOUND, sound ); | 383 | if (::ioctl ( fd, SHARP_BUZZER_MAKESOUND, sound ) == -1) |
384 | qWarning( "HTC::buzzer() - Couldn't make the buzzer buzz (%s)", | ||
385 | strerror( errno ) ); | ||
384 | ::close ( fd ); | 386 | ::close ( fd ); |