summaryrefslogtreecommitdiffstats
path: root/twin
diff options
context:
space:
mode:
Diffstat (limited to 'twin')
-rw-r--r--twin/client.cpp29
-rw-r--r--twin/compton-tde/compton.c4
2 files changed, 33 insertions, 0 deletions
diff --git a/twin/client.cpp b/twin/client.cpp
index b57cab35f..a58fd22f2 100644
--- a/twin/client.cpp
+++ b/twin/client.cpp
@@ -27,6 +27,11 @@ License. See the file "COPYING" for the exact licensing terms.
#include <tdelocale.h>
#include <stdlib.h>
+#ifdef Q_OS_SOLARIS
+#include <procfs.h>
+#include <libgen.h>
+#endif /* SunOS */
+
#include "bridge.h"
#include "group.h"
#include "workspace.h"
@@ -1860,15 +1865,30 @@ bool Client::isSuspendable() const
}
else
{
+#ifdef Q_OS_SOLARIS
+ TQFile procStatFile(TQString("/proc/%1/lwp/1/lwpsinfo").arg(pid));
+#else /* default */
TQFile procStatFile(TQString("/proc/%1/stat").arg(pid));
+#endif
if (procStatFile.open(IO_ReadOnly))
{
TQByteArray statRaw = procStatFile.readAll();
procStatFile.close();
+#ifdef Q_OS_SOLARIS
+ lwpsinfo_t *inf = (lwpsinfo_t *)statRaw.data();
+ char tbuf[PATH_MAX];
+ TQString tcomm;
+ TQString state(TQChar(inf->pr_sname));
+
+ readlink(TQString("/proc/%1/path/a.out").arg(pid).latin1(),
+ tbuf, sizeof(tbuf));
+ tcomm = basename(tbuf);
+#else /* default */
TQString statString(statRaw);
TQStringList statFields = TQStringList::split(" ", statString, TRUE);
TQString tcomm = statFields[1];
TQString state = statFields[2];
+#endif /* default */
if( state != "T" )
{
// Make sure no windows of this process are special
@@ -1921,15 +1941,24 @@ bool Client::isResumeable() const
}
else
{
+#ifdef Q_OS_SOLARIS
+ TQFile procStatFile(TQString("/proc/%1/lwp/1/lwpsinfo").arg(pid));
+#else /* default */
TQFile procStatFile(TQString("/proc/%1/stat").arg(pid));
+#endif
if (procStatFile.open(IO_ReadOnly))
{
TQByteArray statRaw = procStatFile.readAll();
procStatFile.close();
+#ifdef Q_OS_SOLARIS
+ lwpsinfo_t *inf = (lwpsinfo_t *)statRaw.data();
+ TQString state(TQChar(inf->pr_sname));
+#else /* default */
TQString statString(statRaw);
TQStringList statFields = TQStringList::split(" ", statString, TRUE);
TQString tcomm = statFields[1];
TQString state = statFields[2];
+#endif /* default */
if( state == "T" )
{
return true;
diff --git a/twin/compton-tde/compton.c b/twin/compton-tde/compton.c
index 603402fc6..2e76cb6b3 100644
--- a/twin/compton-tde/compton.c
+++ b/twin/compton-tde/compton.c
@@ -161,7 +161,11 @@ void delete_pid_file()
printf("compton-tde lost connection to X server, restarting...\n"); fflush(stdout);
sleep(1);
char me[2048];
+#ifdef Q_OS_SOLARIS
+ int chars = readlink("/proc/self/path/a.out", me, sizeof(me));
+#else /* default */
int chars = readlink("/proc/self/exe", me, sizeof(me));
+#endif /* self exe */
me[chars] = 0;
me[2047] = 0;
execl(me, basename(me), (char*)NULL);