summaryrefslogtreecommitdiffstats
path: root/tdm/backend
diff options
context:
space:
mode:
Diffstat (limited to 'tdm/backend')
-rw-r--r--tdm/backend/CMakeLists.txt3
-rw-r--r--tdm/backend/consolekit.c2
-rw-r--r--tdm/backend/consolekit.h2
-rw-r--r--tdm/backend/ctrl.c1
-rw-r--r--tdm/backend/dm.c31
-rw-r--r--tdm/backend/getfd.c8
-rw-r--r--tdm/backend/xdmcp.c2
7 files changed, 39 insertions, 10 deletions
diff --git a/tdm/backend/CMakeLists.txt b/tdm/backend/CMakeLists.txt
index 8f11c4b34..cb0cd3d3f 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,6 @@ 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 pthread ${XAU_LIBRARIES} ${DBUS_LIBRARIES} ${CRYPT_LIBRARY} ${PAM_LIBRARY} ${UTIL_LIBRARY} ${XDMCP_LIBRARIES}
DESTINATION ${BIN_INSTALL_DIR}
)
diff --git a/tdm/backend/consolekit.c b/tdm/backend/consolekit.c
index 61d0b165e..9a6729b91 100644
--- a/tdm/backend/consolekit.c
+++ b/tdm/backend/consolekit.c
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+/*
Copyright (C) 2006-2007 William Jon McCann <mccann@jhu.edu>
Copyright (C) 2007 Kevin Kofler <Kevin@tigcc.ticalc.org>
diff --git a/tdm/backend/consolekit.h b/tdm/backend/consolekit.h
index e385e3f91..12b5462da 100644
--- a/tdm/backend/consolekit.h
+++ b/tdm/backend/consolekit.h
@@ -1,4 +1,4 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*-
+/*
Copyright (C) 2006 William Jon McCann <mccann@jhu.edu>
Copyright (C) 2007 Kevin Kofler <Kevin@tigcc.ticalc.org>
diff --git a/tdm/backend/ctrl.c b/tdm/backend/ctrl.c
index 1e7cfd07a..cc9540745 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__
diff --git a/tdm/backend/dm.c b/tdm/backend/dm.c
index 605f0b1c4..9168b88b5 100644
--- a/tdm/backend/dm.c
+++ b/tdm/backend/dm.c
@@ -34,6 +34,8 @@ from the copyright holder.
* display manager
*/
+#include <tqglobal.h>
+
#include "dm.h"
#include "dm_auth.h"
#include "dm_error.h"
@@ -51,6 +53,12 @@ from the copyright holder.
# include <sys/vt.h>
#endif
+#ifdef HAVE_PTHREAD_SETNAME_NP
+#define _GNU_SOURCE
+#define __BSD_VISIBLE 1
+#include <pthread.h>
+#endif /* pthread_setname_np() */
+
// Limited by the number of VTs configured into the kernel or 256, whichever is less
#define MAX_VT_NUMBER 48
@@ -66,7 +74,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 +113,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 +123,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 +180,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 +1705,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 +1715,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/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 );