diff --git a/util/qemu-openpty.c b/util/qemu-openpty.c index eb17f5b0bc..427f43a769 100644 --- a/util/qemu-openpty.c +++ b/util/qemu-openpty.c @@ -80,10 +80,9 @@ static int openpty(int *amaster, int *aslave, char *name, (termp != NULL && tcgetattr(sfd, termp) < 0)) goto err; - if (amaster) - *amaster = mfd; - if (aslave) - *aslave = sfd; + *amaster = mfd; + *aslave = sfd; + if (winp) ioctl(sfd, TIOCSWINSZ, winp);