return chr;
}
-#if defined(__linux__)
+#if defined(__linux__) || defined(__sun__)
static CharDriverState *qemu_chr_open_pty(void)
{
struct termios tty;
char slave_name[1024];
int master_fd, slave_fd;
+#if defined(__linux__)
/* Not satisfying */
if (openpty(&master_fd, &slave_fd, slave_name, NULL, NULL) < 0) {
return NULL;
}
+#endif
/* Disabling local echo and line-buffered output */
tcgetattr (master_fd, &tty);
qemu_chr_reset(chr);
return chr;
}
+#else /* ! __linux__ && ! __sun__ */
+static CharDriverState *qemu_chr_open_pty(void)
+{
+ return NULL;
+}
+#endif /* __linux__ || __sun__ */
+#if defined(__linux__)
typedef struct {
int fd;
int mode;
return chr;
}
+#endif /* __linux__ */
-#else
-static CharDriverState *qemu_chr_open_pty(void)
-{
- return NULL;
-}
-#endif
-
-#endif /* !defined(_WIN32) */
+#else /* _WIN32 */
-#ifdef _WIN32
typedef struct {
int max_size;
HANDLE hcom, hrecv, hsend;
return qemu_chr_open_win_file(fd_out);
}
-#endif
+#endif /* !_WIN32 */
/***********************************************************/
/* UDP Net console */
} else if (!strcmp(filename, "stdio")) {
return qemu_chr_open_stdio();
} else
-#endif
#if defined(__linux__)
if (strstart(filename, "/dev/parport", NULL)) {
return qemu_chr_open_pp(filename);
} else
+#endif
if (strstart(filename, "/dev/", NULL)) {
return qemu_chr_open_tty(filename);
} else
-#endif
-#ifdef _WIN32
+#else /* !_WIN32 */
if (strstart(filename, "COM", NULL)) {
return qemu_chr_open_win(filename);
} else