+ errx(EXIT_FAILURE, "Could not initialize libev. Bad LIBEV_FLAGS?");
+
+#if defined(__linux__)
+
+ /* Lock tty switching */
+ if (lock_tty_switching) {
+ if ((term = open("/dev/console", O_RDWR)) == -1) {
+ perror("error locking TTY switching: opening console failed");
+ }
+
+ if (term != -1 && (ioctl(term, VT_LOCKSWITCH)) == -1) {
+ perror("error locking TTY switching: locking console failed");
+ }
+ }
+
+#endif