bool
-vshTTYIsInterruptCharacter(vshControl *ctl,
- const char chr)
+vshTTYIsInterruptCharacter(vshControl *ctl ATTRIBUTE_UNUSED,
+ const char chr ATTRIBUTE_UNUSED)
{
+#ifndef WIN32
if (ctl->istty &&
ctl->termattr.c_cc[VINTR] == chr)
return true;
+#endif
return false;
}
int
-vshTTYDisableInterrupt(vshControl *ctl)
+vshTTYDisableInterrupt(vshControl *ctl ATTRIBUTE_UNUSED)
{
+#ifndef WIN32
struct termios termset = ctl->termattr;
if (!ctl->istty)
if (tcsetattr(STDIN_FILENO, TCSANOW, &termset) < 0)
return -1;
+#endif
return 0;
}
int
-vshTTYRestore(vshControl *ctl)
+vshTTYRestore(vshControl *ctl ATTRIBUTE_UNUSED)
{
+#ifndef WIN32
if (!ctl->istty)
return 0;
if (tcsetattr(STDIN_FILENO, TCSAFLUSH, &ctl->termattr) < 0)
return -1;
+#endif
return 0;
}
-#ifndef HAVE_CFMAKERAW
+#if !defined(WIN32) && !defined(HAVE_CFMAKERAW)
/* provide fallback in case cfmakeraw isn't available */
static void
cfmakeraw(struct termios *attr)
attr->c_cflag &= ~(CSIZE | PARENB);
attr->c_cflag |= CS8;
}
-#endif /* !HAVE_CFMAKERAW */
+#endif /* !WIN32 && !HAVE_CFMAKERAW */
int
-vshTTYMakeRaw(vshControl *ctl, bool report_errors)
+vshTTYMakeRaw(vshControl *ctl ATTRIBUTE_UNUSED,
+ bool report_errors ATTRIBUTE_UNUSED)
{
+#ifndef WIN32
struct termios rawattr = ctl->termattr;
char ebuf[1024];
virStrerror(errno, ebuf, sizeof(ebuf)));
return -1;
}
+#endif
return 0;
}
if (isatty(STDIN_FILENO)) {
ctl->istty = true;
+#ifndef WIN32
if (tcgetattr(STDIN_FILENO, &ctl->termattr) < 0)
ctl->istty = false;
+#endif
}
if (virMutexInit(&ctl->lock) < 0) {