Fix nagging make_dev() warnings

Frank W. Josellis frank at dynamical-systems.org
Sun Sep 24 05:38:17 PDT 2006


An inspection of sys/kern/tty_cons.c shows that the reported replacement 
"sc" -> "intercept" is indeed intentional. It just means that the dev_ops 
has been substituted as desired. Then, however, requiring

[*]	(si->si_ops == ops && si->si_udev == udev)

in hashdev() looks inappropriate, as this prevents the intercepted device 
from being successfully looked up from the hash table. Strictly speaking, 
dev_ops_get(12,255) returns the ops of the original device, and this is 
used by udev2dev() for a subsequent hashdev() call. As a consequence one 
has si_ops != ops and [*] is not matched. Once the interception is 
established, the next attempt to open consolectl thus results in the 
creation of a new device whose si_ops is the original one. This effects 
a complete bypassing of the intercepted device.

I can't figure out why the condition "si->si_ops == ops" in [*] had been 
added. For testing purposes I dropped this to see what goes wrong, but 
everything still looks fine. Anyway, in view if the new intercept code it 
appears that here is a point which should be reconsidered.

Regards,
Frank Josellis






More information about the Bugs mailing list