summaryrefslogtreecommitdiff
path: root/libopie
authormickeyl <mickeyl>2003-05-07 13:44:23 (UTC)
committer mickeyl <mickeyl>2003-05-07 13:44:23 (UTC)
commit4619398b4712062e65d1919156edea38785c590e (patch) (unidiff)
tree4d00604960974ca16f9d40468bce4c096e2a76b0 /libopie
parent83f53eede83728c131b1134ae0a674a7d8f6f00a (diff)
downloadopie-4619398b4712062e65d1919156edea38785c590e.zip
opie-4619398b4712062e65d1919156edea38785c590e.tar.gz
opie-4619398b4712062e65d1919156edea38785c590e.tar.bz2
fix bug kergoth introduced in rev 1.43
fd was an integer static to the function which means that the assignment only happens once. This is ok, when we don't close the device, but not if we close it after usage. Thanks to eilers for confirming! I wonder why noone else spotted this...
Diffstat (limited to 'libopie') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/odevice.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp
index 62e3569..7d862cd 100644
--- a/libopie/odevice.cpp
+++ b/libopie/odevice.cpp
@@ -1295,25 +1295,25 @@ typedef struct sharp_led_status {
1295 1295
1296// #include <asm/sharp_apm.h> // including kernel headers is evil ... 1296// #include <asm/sharp_apm.h> // including kernel headers is evil ...
1297 1297
1298#define APM_IOCGEVTSRC OD_IOR( 'A', 203, int ) 1298#define APM_IOCGEVTSRC OD_IOR( 'A', 203, int )
1299#define APM_IOCSEVTSRC OD_IORW( 'A', 204, int ) 1299#define APM_IOCSEVTSRC OD_IORW( 'A', 204, int )
1300#define APM_EVT_POWER_BUTTON (1 << 0) 1300#define APM_EVT_POWER_BUTTON (1 << 0)
1301 1301
1302#define FL_IOCTL_STEP_CONTRAST 100 1302#define FL_IOCTL_STEP_CONTRAST 100
1303 1303
1304 1304
1305void Zaurus::buzzer ( int sound ) 1305void Zaurus::buzzer ( int sound )
1306{ 1306{
1307 static int fd = ::open ( "/dev/sharp_buz", O_WRONLY|O_NONBLOCK ); 1307 int fd = ::open ( "/dev/sharp_buz", O_WRONLY|O_NONBLOCK );
1308 1308
1309 if ( fd >= 0 ) { 1309 if ( fd >= 0 ) {
1310 ::ioctl ( fd, SHARP_BUZZER_MAKESOUND, sound ); 1310 ::ioctl ( fd, SHARP_BUZZER_MAKESOUND, sound );
1311 ::close ( fd ); 1311 ::close ( fd );
1312 } 1312 }
1313} 1313}
1314 1314
1315 1315
1316void Zaurus::alarmSound ( ) 1316void Zaurus::alarmSound ( )
1317{ 1317{
1318 buzzer ( SHARP_BUZ_SCHEDULE_ALARM ); 1318 buzzer ( SHARP_BUZ_SCHEDULE_ALARM );
1319} 1319}