From 4d817fc1001e98f45985b1c8f78c3dcc0ef7d57f Mon Sep 17 00:00:00 2001 From: Ivailo Monev Date: Wed, 23 Feb 2022 20:46:54 +0200 Subject: [PATCH] kpty: move variable to the condition it is used in Signed-off-by: Ivailo Monev --- kpty/kpty.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kpty/kpty.cpp b/kpty/kpty.cpp index 67804e19..d2296207 100644 --- a/kpty/kpty.cpp +++ b/kpty/kpty.cpp @@ -146,8 +146,6 @@ bool KPty::open() d->ownMaster = true; - QByteArray ptyName; - // Find a master pty that we can open //////////////////////////////// // Because not all the pty animals are created equal, they want to @@ -169,6 +167,8 @@ bool KPty::open() #else + QByteArray ptyName; + d->masterFd = ::posix_openpt(O_RDWR|O_NOCTTY); if (d->masterFd >= 0) {