Skip to content

Commit

Permalink
Build for mac os without significant changes of master's code (insead…
Browse files Browse the repository at this point in the history
… of osx branch). A bit later I can provide signed binary build for osx.
  • Loading branch information
Anton Simakov committed Oct 9, 2014
1 parent 9bd0ca7 commit a78231e
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,8 @@ Makefile*
# Excludes compiled files
imports
cool-retro-term

# Mac OSX

.DS_Store
*.app
5 changes: 4 additions & 1 deletion konsole-qml-plugin/konsole-qml-plugin.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions konsole-qml-plugin/src/kpty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit a78231e

Please sign in to comment.