}
/* Get the state of the console -- in particular, the free VT field */
- if (ioctl(console_fd,VT_GETSTATE,&vts))
+ if (ioctl(console_fd,VT_GETSTATE,&vts)) {
+ close(console_fd);
return -2;
+ }
close(console_fd);
/* We attempt to set our euid to 0; if we were run with euid 0 to
mi_aux_term *gmi_look_for_free_vt()
{
+ int ret;
int vt=mi_look_for_free_vt();
mi_aux_term *res;
if (!res)
return NULL;
res->pid=-1;
- asprintf(&res->tty,"/dev/tty%d",vt);
+ ret = asprintf(&res->tty,"/dev/tty%d",vt);
return res;
}