mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-23 18:32:49 +00:00
generic: drop libutempter support
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
504b2db6ee
commit
9b97882c3d
4 changed files with 77 additions and 105 deletions
|
@ -93,12 +93,6 @@ if (UNIX)
|
|||
|
||||
set(UTIL_LIBRARY)
|
||||
|
||||
check_library_exists(utempter addToUtmp "" HAVE_ADDTOUTEMP)
|
||||
check_include_files(utempter.h HAVE_UTEMPTER_H)
|
||||
if (HAVE_ADDTOUTEMP AND HAVE_UTEMPTER_H)
|
||||
set(HAVE_UTEMPTER 1)
|
||||
set(UTEMPTER_LIBRARY utempter)
|
||||
else (HAVE_ADDTOUTEMP AND HAVE_UTEMPTER_H)
|
||||
check_function_exists(login login_in_libc)
|
||||
if (NOT login_in_libc)
|
||||
check_library_exists(util login "" login_in_libutil)
|
||||
|
@ -129,7 +123,6 @@ if (UNIX)
|
|||
check_struct_has_member("struct ${utmp}" "ut_session" "${utmp}.h" HAVE_STRUCT_UTMP_UT_SESSION)
|
||||
check_struct_has_member("struct ${utmp}" "ut_syslen" "${utmp}.h" HAVE_STRUCT_UTMP_UT_SYSLEN)
|
||||
check_struct_has_member("struct ${utmp}" "ut_id" "${utmp}.h" HAVE_STRUCT_UTMP_UT_ID)
|
||||
endif (HAVE_ADDTOUTEMP AND HAVE_UTEMPTER_H)
|
||||
|
||||
check_function_exists(openpty openpty_in_libc)
|
||||
if (NOT openpty_in_libc)
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
#cmakedefine HAVE_SYS_STROPTS_H 1
|
||||
#cmakedefine HAVE_SYS_FILIO_H 1
|
||||
|
||||
#cmakedefine HAVE_UTEMPTER 1
|
||||
#cmakedefine HAVE_LOGIN 1
|
||||
#cmakedefine HAVE_UTMPX 1
|
||||
#cmakedefine HAVE_LOGINX 1
|
||||
|
|
|
@ -12,7 +12,6 @@ add_library(kpty ${LIBRARY_TYPE} ${kpty_LIB_SRCS})
|
|||
|
||||
target_link_libraries(kpty PRIVATE
|
||||
${UTIL_LIBRARY}
|
||||
${UTEMPTER_LIBRARY}
|
||||
)
|
||||
|
||||
target_link_libraries(kpty PUBLIC
|
||||
|
|
|
@ -51,11 +51,6 @@
|
|||
# include <util.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UTEMPTER
|
||||
extern "C" {
|
||||
# include <utempter.h>
|
||||
}
|
||||
#else
|
||||
#ifdef HAVE_UTMPX
|
||||
# include <utmpx.h>
|
||||
#else
|
||||
|
@ -67,7 +62,6 @@ extern "C" {
|
|||
#if !defined(_PATH_WTMPX) && defined(_WTMPX_FILE)
|
||||
# define _PATH_WTMPX _WTMPX_FILE
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* for HP-UX (some versions) the extern C is needed, and for other
|
||||
platforms it doesn't hurt */
|
||||
|
@ -465,12 +459,6 @@ void KPty::setCTty()
|
|||
|
||||
void KPty::login(const char *user, const char *remotehost)
|
||||
{
|
||||
#ifdef HAVE_UTEMPTER
|
||||
Q_D(KPty);
|
||||
|
||||
addToUtmp(d->ttyName, remotehost, d->masterFd);
|
||||
Q_UNUSED(user);
|
||||
#else
|
||||
#ifdef HAVE_UTMPX
|
||||
struct utmpx l_struct;
|
||||
#else
|
||||
|
@ -516,6 +504,7 @@ void KPty::login(const char *user, const char *remotehost)
|
|||
#endif
|
||||
#ifdef HAVE_STRUCT_UTMP_UT_PID
|
||||
l_struct.ut_pid = getpid();
|
||||
#endif
|
||||
#ifdef HAVE_STRUCT_UTMP_UT_SESSION
|
||||
l_struct.ut_session = getsid(0);
|
||||
#endif
|
||||
|
@ -537,17 +526,10 @@ void KPty::login(const char *user, const char *remotehost)
|
|||
endutent();
|
||||
updwtmp(_PATH_WTMP, &l_struct);
|
||||
#endif
|
||||
# endif
|
||||
#endif
|
||||
}
|
||||
|
||||
void KPty::logout()
|
||||
{
|
||||
#ifdef HAVE_UTEMPTER
|
||||
Q_D(KPty);
|
||||
|
||||
removeLineFromUtmp(d->ttyName, d->masterFd);
|
||||
#else
|
||||
Q_D(KPty);
|
||||
|
||||
const char *str_ptr = d->ttyName.data();
|
||||
|
@ -603,7 +585,6 @@ void KPty::logout()
|
|||
endutent();
|
||||
# endif
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
bool KPty::tcGetAttr(struct ::termios *ttmode) const
|
||||
|
|
Loading…
Add table
Reference in a new issue