1
0
mirror of https://github.com/Swordfish90/cool-retro-term.git synced 2025-01-18 12:15:27 +00:00

Build for mac os without significant changes of master's code (insead of osx branch). A bit later I can provide signed binary build for osx.

This commit is contained in:
Anton Simakov 2014-10-09 21:27:26 +04:00
parent 9bd0ca74b6
commit a78231eac5
3 changed files with 19 additions and 1 deletions

5
.gitignore vendored
View File

@ -42,3 +42,8 @@ Makefile*
# Excludes compiled files
imports
cool-retro-term
# Mac OSX
.DS_Store
*.app

View File

@ -6,7 +6,10 @@ TEMPLATE = lib
CONFIG += qt plugin hide_symbols
QT += qml quick widgets
DEFINES += HAVE_POSIX_OPENPT HAVE_SYS_TIME_H HAVE_UPDWTMPX
DEFINES += HAVE_POSIX_OPENPT HAVE_SYS_TIME_H
!macx:DEFINES += HAVE_UPDWTMPX
macx:DEFINES += HAVE_UTMPX HAVE_UT_USER
#MANUALY DEFINED PLATFORM
DEFINES += Q_WS_UBUNTU

View File

@ -506,7 +506,11 @@ void KPty::login(const char * user, const char * remotehost)
// note: strncpy without terminators _is_ correct here. man 4 utmp
if (user) {
# ifdef HAVE_UT_USER
strncpy(l_struct.ut_user, user, sizeof(l_struct.ut_user));
#elif
strncpy(l_struct.ut_name, user, sizeof(l_struct.ut_name));
#endif
}
if (remotehost) {
@ -617,7 +621,13 @@ void KPty::logout()
setutent();
if ((ut = getutline(&l_struct))) {
# endif
# ifdef HAVE_UT_USER
memset(ut->ut_user, 0, sizeof(*ut->ut_user));
#elif
memset(ut->ut_name, 0, sizeof(*ut->ut_name));
#endif
memset(ut->ut_host, 0, sizeof(*ut->ut_host));
# ifdef HAVE_STRUCT_UTMP_UT_SYSLEN
ut->ut_syslen = 0;