diff --git a/module/tty0tty.c b/module/tty0tty.c index 1628621..a280991 100644 --- a/module/tty0tty.c +++ b/module/tty0tty.c @@ -103,7 +103,11 @@ static int tty0tty_open(struct tty_struct *tty, struct file *file) if (!tty0tty) return -ENOMEM; +#ifdef __LINUX_SEMAPHORE_H + sema_init(&tty0tty->sem, 1); +#else init_MUTEX(&tty0tty->sem); +#endif tty0tty->open_count = 0; tty0tty_table[index] = tty0tty;