patch-2.3.99-pre6 linux/drivers/char/random.c

Next file: linux/drivers/char/rtc.c
Previous file: linux/drivers/char/pty.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.99-pre5/linux/drivers/char/random.c linux/drivers/char/random.c
@@ -763,7 +763,12 @@
 
 void add_keyboard_randomness(unsigned char scancode)
 {
-	add_timer_randomness(&keyboard_timer_state, scancode);
+	static unsigned char last_scancode = 0;
+	/* ignore autorepeat (multiple key down w/o key up) */
+	if (scancode != last_scancode) {
+		last_scancode = scancode;
+		add_timer_randomness(&keyboard_timer_state, scancode);
+	}
 }
 
 void add_mouse_randomness(__u32 mouse_data)

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)