diff -up xorg-server-1.3.0.0/hw/xfree86/os-support/linux/lnx_init.c.jx xorg-server-1.3.0.0/hw/xfree86/os-support/linux/lnx_init.c
--- xorg-server-1.3.0.0/hw/xfree86/os-support/linux/lnx_init.c.jx 2007-11-01 20:20:37.000000000 -0400
+++ xorg-server-1.3.0.0/hw/xfree86/os-support/linux/lnx_init.c 2007-11-01 20:33:00.000000000 -0400
@@ -87,7 +87,7 @@ restoreVtPerms(void)
void
xf86OpenConsole(void)
{
- int i, fd = -1;
+ int i, fd = -1, ret;
struct vt_mode VT;
struct vt_stat vts;
MessageType from = X_PROBED;
@@ -252,12 +252,18 @@ xf86OpenConsole(void)
* So we have to fail in that case. There's really no fixing this,
* it's a racy protocol.
*/
- if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) < 0)
+ SYSCALL(
+ ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno)
+ );
+ if (ret < 0)
FatalError("xf86OpenConsole: VT_ACTIVATE failed: %s\n",
strerror(errno));
- if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) < 0)
+ SYSCALL(
+ ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno)
+ );
+ if (ret < 0)
FatalError("xf86OpenConsole: VT_WAITACTIVE failed: %s\n",
strerror(errno));
@@ -300,14 +306,20 @@ xf86OpenConsole(void)
/*
* now get the VT
*/
- if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno) < 0)
+ SYSCALL(
+ ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, xf86Info.vtno)
+ );
+ if (ret < 0)
xf86Msg(X_WARNING, "xf86OpenConsole: VT_ACTIVATE failed %s\n",
strerror(errno));
}
- if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno) < 0)
- xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed %s\n",
- strerror(errno));
+ SYSCALL(
+ ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, xf86Info.vtno)
+ );
+ if (ret < 0)
+ xf86Msg(X_WARNING, "xf86OpenConsole: VT_WAITACTIVE failed %s\n",
+ strerror(errno));
}
return;
}
@@ -349,14 +361,21 @@ xf86CloseConsole()
if (VTSwitch)
{
+ int ret;
/*
* Perform a switch back to the active VT when we were started
*/
if (activeVT >= 0) {
- if (ioctl(xf86Info.consoleFd, VT_ACTIVATE, activeVT) < 0)
+ SYSCALL(
+ ret = ioctl(xf86Info.consoleFd, VT_ACTIVATE, activeVT)
+ );
+ if (ret < 0)
xf86Msg(X_WARNING, "xf86CloseConsole: VT_ACTIVATE failed: %s\n",
strerror(errno));
- if (ioctl(xf86Info.consoleFd, VT_WAITACTIVE, activeVT) < 0)
+ SYSCALL(
+ ret = ioctl(xf86Info.consoleFd, VT_WAITACTIVE, activeVT)
+ );
+ if (ret < 0)
xf86Msg(X_WARNING, "xf86CloseConsole: VT_WAITACTIVE failed: %s\n",
strerror(errno));
activeVT = -1;