From: Aivils S. <ai...@us...> - 2003-12-23 07:44:05
|
Update of /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char In directory sc8-pr-cvs1:/tmp/cvs-serv14305/ruby-2.6/drivers/char Modified Files: consolemap.c vt.c vt_proc.c Log Message: list misunderstanding nasty bug Index: consolemap.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/consolemap.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- consolemap.c 28 Oct 2003 07:14:53 -0000 1.3 +++ consolemap.c 23 Dec 2003 07:44:02 -0000 1.4 @@ -667,9 +667,11 @@ void __init console_map_init(void) { - struct vt_struct *vt = (struct vt_struct *) vt_list.prev; + struct vt_struct *vt; int i; + vt = list_entry(vt_list.next, typeof(*vt), node); + for (i = 0; i < vt->vc_count; i++) { struct vc_data *vc = vt->vc_cons[i]; Index: vt.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/vt.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- vt.c 3 Dec 2003 07:27:18 -0000 1.12 +++ vt.c 23 Dec 2003 07:44:02 -0000 1.13 @@ -1813,7 +1813,7 @@ int __init vty_init(void) { - if (!vt_list.prev) + if (list_empty(&vt_list)) return -ENXIO; console_driver = alloc_tty_driver(MAX_NR_CONSOLES); Index: vt_proc.c =================================================================== RCS file: /cvsroot/linuxconsole/ruby/ruby-2.6/drivers/char/vt_proc.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- vt_proc.c 28 Oct 2003 07:14:53 -0000 1.2 +++ vt_proc.c 23 Dec 2003 07:44:02 -0000 1.3 @@ -177,13 +177,16 @@ int __init vt_proc_init(void) { struct vt_struct *vt; - if (vt_list.prev) { - proc_bus_console_dir = proc_mkdir(VT_PROC_DIR, proc_bus); - list_for_each_entry (vt, &vt_list, node) { - vt_proc_attach(vt); - } - } - return 0; + + if (list_empty(&vt_list)) + return 0; + + proc_bus_console_dir = proc_mkdir(VT_PROC_DIR, proc_bus); + list_for_each_entry (vt, &vt_list, node) { + vt_proc_attach(vt); + } + + return 0; } #endif /* CONFIG_PROC_FS */ |