assume tcsetpgrp() is available

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2021-11-11 05:28:45 +02:00
parent 86482a7909
commit d4f1f1f270

View file

@ -410,12 +410,7 @@ void KPty::setCTty()
#endif
// make our new process group the foreground group on the pty
int pgrp = getpid();
#if defined(_POSIX_VERSION)
tcsetpgrp(d->slaveFd, pgrp);
#elif defined(TIOCSPGRP)
ioctl(d->slaveFd, TIOCSPGRP, (char *)&pgrp);
#endif
::tcsetpgrp(d->slaveFd, ::getpid());
}
void KPty::login(const char *user, const char *remotehost)
@ -472,7 +467,7 @@ void KPty::login(const char *user, const char *remotehost)
l_struct.ut_type = USER_PROCESS;
#endif
#ifdef HAVE_STRUCT_UTMP_UT_PID
l_struct.ut_pid = getpid();
l_struct.ut_pid = ::getpid();
#endif
#ifdef HAVE_STRUCT_UTMP_UT_SESSION
l_struct.ut_session = getsid(0);