161 |
*r_vcons = previous_cons; |
*r_vcons = previous_cons; |
162 |
return 0; |
return 0; |
163 |
} |
} |
164 |
else if (!create) |
} |
165 |
{ |
else if (!create) |
166 |
mutex_unlock (&cons_list_lock); |
{ |
167 |
return ESRCH; |
mutex_unlock (&cons_list_lock); |
168 |
} |
return ESRCH; |
169 |
} |
} |
170 |
} |
} |
171 |
else |
else |
236 |
vcons_release (vcons_t vcons) |
vcons_release (vcons_t vcons) |
237 |
{ |
{ |
238 |
mutex_lock (&cons_list_lock); |
mutex_lock (&cons_list_lock); |
239 |
if (--vcons->refcnt) |
if (!--vcons->refcnt) |
240 |
{ |
{ |
241 |
/* As we keep a reference for all input focus groups pointing to |
/* As we keep a reference for all input focus groups pointing to |
242 |
the virtual console, and a reference for the active console, |
the virtual console, and a reference for the active console, |
250 |
vcons->prev->next = vcons->next; |
vcons->prev->next = vcons->next; |
251 |
if (vcons->next) |
if (vcons->next) |
252 |
vcons->next->prev = vcons->prev; |
vcons->next->prev = vcons->prev; |
253 |
|
if (!vcons->prev && !vcons->next) |
254 |
|
vcons->cons->vcons_list = NULL; |
255 |
vcons->cons->vcons_length--; |
vcons->cons->vcons_length--; |
256 |
vcons->cons->refcnt--; |
vcons->cons->refcnt--; |
257 |
free (vcons); |
free (vcons); |