Commit 9dd38130f1647deb6f2fc01508b4e0b0f8ecfc4c
1 parent
80d9c5ee
Fix for modern semaphore functions.
Showing
1 changed file
with
4 additions
and
0 deletions
module/tty0tty.c
| @@ -103,7 +103,11 @@ static int tty0tty_open(struct tty_struct *tty, struct file *file) | @@ -103,7 +103,11 @@ static int tty0tty_open(struct tty_struct *tty, struct file *file) | ||
| 103 | if (!tty0tty) | 103 | if (!tty0tty) |
| 104 | return -ENOMEM; | 104 | return -ENOMEM; |
| 105 | 105 | ||
| 106 | +#ifdef __LINUX_SEMAPHORE_H | ||
| 107 | + sema_init(&tty0tty->sem, 1); | ||
| 108 | +#else | ||
| 106 | init_MUTEX(&tty0tty->sem); | 109 | init_MUTEX(&tty0tty->sem); |
| 110 | +#endif | ||
| 107 | tty0tty->open_count = 0; | 111 | tty0tty->open_count = 0; |
| 108 | 112 | ||
| 109 | tty0tty_table[index] = tty0tty; | 113 | tty0tty_table[index] = tty0tty; |