diff --git a/lib/libutil/pty.c b/lib/libutil/pty.c index fbc170fabdf7..900c201ab831 100644 --- a/lib/libutil/pty.c +++ b/lib/libutil/pty.c @@ -70,6 +70,7 @@ openpty(int *amaster, int *aslave, char *name, struct termios *term, mode_t mode; struct group grs, *grp; char grbuf[1024]; + struct ptmget pt; _DIAGASSERT(amaster != NULL); _DIAGASSERT(aslave != NULL); @@ -78,7 +79,6 @@ openpty(int *amaster, int *aslave, char *name, struct termios *term, /* winp may be NULL */ if ((master = open("/dev/ptm", O_RDWR)) != -1) { - struct ptmget pt; if (ioctl(master, TIOCPTMGET, &pt) != -1) { (void)close(master); master = pt.cfd;