summaryrefslogtreecommitdiffstats
path: root/tdm/backend
diff options
context:
space:
mode:
Diffstat (limited to 'tdm/backend')
-rw-r--r--tdm/backend/CMakeLists.txt5
-rw-r--r--tdm/backend/ctrl.c3
-rw-r--r--tdm/backend/dm.c32
-rw-r--r--tdm/backend/dm.h4
-rw-r--r--tdm/backend/getfd.c8
-rw-r--r--tdm/backend/xdmcp.c2
6 files changed, 41 insertions, 13 deletions
diff --git a/tdm/backend/CMakeLists.txt b/tdm/backend/CMakeLists.txt
index 8f11c4b34..a9144d5ff 100644
--- a/tdm/backend/CMakeLists.txt
+++ b/tdm/backend/CMakeLists.txt
@@ -18,6 +18,7 @@ include_directories(
${CMAKE_SOURCE_DIR}/tdm/kfrontend
${XAU_INCLUDE_DIRS}
${XDMCP_INCLUDE_DIRS}
+ ${TQT_INCLUDE_DIRS}
)
link_directories(
@@ -48,6 +49,8 @@ tde_add_executable( tdm
process.c protodpy.c reset.c resource.c rpcauth.c
server.c session.c sessreg.c socket.c streams.c
util.c xdmauth.c xdmcp.c
- LINK X11 ${XAU_LIBRARIES} ${DBUS_LIBRARIES} ${CRYPT_LIBRARY} ${PAM_LIBRARY} ${UTIL_LIBRARY} ${XDMCP_LIBRARIES}
+ LINK
+ X11 ${CMAKE_THREAD_LIBS_INIT} ${XAU_LIBRARIES} ${DBUS_LIBRARIES} ${CRYPT_LIBRARY}
+ ${PAM_LIBRARY} ${UTIL_LIBRARY} ${XDMCP_LIBRARIES}
DESTINATION ${BIN_INSTALL_DIR}
)
diff --git a/tdm/backend/ctrl.c b/tdm/backend/ctrl.c
index 1e7cfd07a..200b7056b 100644
--- a/tdm/backend/ctrl.c
+++ b/tdm/backend/ctrl.c
@@ -41,6 +41,7 @@ from the copyright holder.
#include <string.h>
#include <signal.h>
#include <pwd.h>
+#include <sys/ioctl.h>
#include <sys/stat.h>
#ifdef __linux__
@@ -591,7 +592,7 @@ processCtrl( const char *string, int len, int fd, struct display *d )
} else if (fd >= 0 && !strcmp( ar[0], "activevt" )) {
#ifdef HAVE_VTS
Reply( "ok" );
- int vt_fd = getfd(NULL);
+ int vt_fd = getfd();
if (vt_fd > 0) {
struct vt_stat vtstat;
if (!ioctl(vt_fd, VT_GETSTATE, &vtstat)) {
diff --git a/tdm/backend/dm.c b/tdm/backend/dm.c
index 605f0b1c4..05dfb7a5b 100644
--- a/tdm/backend/dm.c
+++ b/tdm/backend/dm.c
@@ -34,6 +34,15 @@ from the copyright holder.
* display manager
*/
+#include <tqglobal.h>
+
+#include <config.h>
+#ifdef HAVE_PTHREAD_SETNAME_NP
+#define _GNU_SOURCE
+#define __BSD_VISIBLE 1
+#include <pthread.h>
+#endif /* pthread_setname_np() */
+
#include "dm.h"
#include "dm_auth.h"
#include "dm_error.h"
@@ -66,7 +75,8 @@ static void MainLoop( void );
static int signalFds[2];
-#if !defined(HAVE_SETPROCTITLE) && !defined(NOXDMTITLE)
+#if !defined(HAVE_SETPROCTITLE) && !defined(NOXDMTITLE) && \
+ !defined(HAVE_PTHREAD_SETNAME_NP)
static char *Title;
static int TitleLen;
#endif
@@ -104,7 +114,7 @@ main( int argc, char **argv )
if (!StrDup( &progpath, argv[0] ))
Panic( "Out of memory" );
} else
-#ifdef __linux__
+#ifdef Q_OS_LINUX
{
/* note that this will resolve symlinks ... */
int len;
@@ -114,6 +124,16 @@ main( int argc, char **argv )
if (!StrNDup( &progpath, fullpath, len ))
Panic( "Out of memory" );
}
+#elif defined(Q_OS_SOLARIS)
+ {
+ /* note that this will resolve symlinks ... */
+ int len;
+ char fullpath[PATH_MAX];
+ if ((len = readlink( "/proc/self/path/a.out", fullpath, sizeof(fullpath) )) < 0)
+ Panic( "Invoke with full path specification or mount /proc" );
+ if (!StrNDup( &progpath, fullpath, len ))
+ Panic( "Out of memory" );
+ }
#else
# if 0
Panic( "Must be invoked with full path specification" );
@@ -161,7 +181,8 @@ main( int argc, char **argv )
#endif
prog = strrchr( progpath, '/' ) + 1;
-#if !defined(HAVE_SETPROCTITLE) && !defined(NOXDMTITLE)
+#if !defined(HAVE_SETPROCTITLE) && !defined(NOXDMTITLE) && \
+ !defined(HAVE_PTHREAD_SETNAME_NP)
Title = argv[0];
TitleLen = (argv[argc - 1] + strlen( argv[argc - 1] )) - Title;
#endif
@@ -1685,7 +1706,8 @@ UnlockPidFile( void )
void
SetTitle( const char *name )
{
-#if !defined(HAVE_SETPROCTITLE) && !defined(NOXDMTITLE)
+#if !defined(HAVE_SETPROCTITLE) && !defined(NOXDMTITLE) && \
+ !defined(HAVE_PTHREAD_SETNAME_NP)
char *p;
int left;
#endif
@@ -1694,6 +1716,8 @@ SetTitle( const char *name )
ReInitErrorLog();
#ifdef HAVE_SETPROCTITLE
setproctitle( "%s", name );
+#elif defined(HAVE_PTHREAD_SETNAME_NP)
+ pthread_setname_np(pthread_self(), name);
#elif !defined(NOXDMTITLE)
p = Title;
left = TitleLen;
diff --git a/tdm/backend/dm.h b/tdm/backend/dm.h
index ae731aeca..c3d327a5e 100644
--- a/tdm/backend/dm.h
+++ b/tdm/backend/dm.h
@@ -61,10 +61,6 @@ from the copyright holder.
#include <errno.h>
#ifdef XDMCP
-# if defined(__osf__)
-/* someone somewhere defines QUERY under Tru64 which confuses Xdmcp.h */
-# undef QUERY
-# endif
# include <X11/Xdmcp.h>
#endif
diff --git a/tdm/backend/getfd.c b/tdm/backend/getfd.c
index aaad616b6..6dea4f56c 100644
--- a/tdm/backend/getfd.c
+++ b/tdm/backend/getfd.c
@@ -1,12 +1,15 @@
+#include <tqglobal.h>
+
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/ioctl.h>
-#ifdef __linux__
+#ifdef Q_OS_LINUX
#include <linux/kd.h>
#endif
+
#include "getfd.h"
/*
@@ -22,7 +25,8 @@ is_a_console(int fd) {
char arg;
arg = 0;
-#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__)
+#if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) ||\
+ defined(Q_OS_SOLARIS)
return arg;
#else
return (ioctl(fd, KDGKBTYPE, &arg) == 0
diff --git a/tdm/backend/xdmcp.c b/tdm/backend/xdmcp.c
index 6abaf5fc8..85bea54be 100644
--- a/tdm/backend/xdmcp.c
+++ b/tdm/backend/xdmcp.c
@@ -160,7 +160,7 @@ all_query_respond( struct sockaddr *from, int fromlen,
int family;
int length;
- family = ConvertAddr( (XdmcpNetaddr)from, &length, &(addr.data) );
+ family = ConvertAddr( (XdmcpNetaddr)from, &length, (char**)&(addr.data) );
addr.length = length; /* convert int to short */
Debug( "all_query_respond: conntype=%d, addr=%02[*:hhx\n",
family, addr.length, addr.data );