summaryrefslogtreecommitdiffstats
path: root/twin
diff options
context:
space:
mode:
authorDenis Kozadaev <denis@dilos.org>2023-05-18 21:41:25 +0300
committerSlávek Banko <slavek.banko@axis.cz>2023-05-22 20:07:54 +0200
commit4d58a4ea8daf1a3cb91b7d8c6e574dd6f5bdb685 (patch)
tree564b7622f7025d976f0a0ac1cd9ed82ea14239dd /twin
parentbd5494bc81ed0034cde41a34e6a6e8b813b7814b (diff)
downloadtdebase-4d58a4ea8daf1a3cb91b7d8c6e574dd6f5bdb685.tar.gz
tdebase-4d58a4ea8daf1a3cb91b7d8c6e574dd6f5bdb685.zip
SunOS specific patches
Signed-off-by: Denis Kozadaev <denis@dilos.org>
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);