2.0.35 vt.c -- possible bug, patch

James Mayer (james.mayer@acm.org)
Fri, 17 Jul 1998 23:25:06 -0600


When Minicom is being used to dial a modem, a connection alarm (series
of tones) is generated using the ioctl(0, KIOCSOUND, ...) system call,
like so (last two calls only):

ioctl(0, KIOCSOUND, 0x640) = 0
select([...][...]) = 0
ioctl(0, KIOCSOUND, 0) = 0

Unfortunately, the new mksound_lock is set upon entry of _kd_mksound()
-- normally OK, but when "count" is zero, a call to kd_nosound(0) is
made -- which tests that mksound_lock is 0, which then fails. End
result: Minicom alarm sounds, and the last tone never stops.

Anyway, here's a patch which seems to fix the problem:

--- linux-2.0.35.official/drivers/char/vt.c Fri Jul 17 22:55:22 1998
+++ linux/drivers/char/vt.c Fri Jul 17 22:59:11 1998
@@ -189,9 +189,13 @@
sound_timer.expires = jiffies+ticks;
add_timer(&sound_timer);
}
- } else
- kd_nosound(0);
-
+ } else {
+ /* clear the bit set above, so kd_nosound()
+ will function properly. */
+ clear_bit(0, &mksound_lock);
+ kd_nosound(0);
+ }
+
mksound_lock = 0;
}
return;

Thanks for a great OS!
- Jim

--
 --->  ziggy Linux 2.0.35 i586
Do not believe in miracles -- rely on them.

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html