aboutsummaryrefslogtreecommitdiff
path: root/nxcomp
diff options
context:
space:
mode:
Diffstat (limited to 'nxcomp')
-rw-r--r--nxcomp/Agent.h2
-rw-r--r--nxcomp/ClearArea.cpp2
-rw-r--r--nxcomp/Loop.cpp27
-rw-r--r--nxcomp/Misc.h1
-rw-r--r--nxcomp/NX.h8
-rw-r--r--nxcomp/Proxy.cpp2
6 files changed, 39 insertions, 3 deletions
diff --git a/nxcomp/Agent.h b/nxcomp/Agent.h
index ded344d84..2c5badf53 100644
--- a/nxcomp/Agent.h
+++ b/nxcomp/Agent.h
@@ -217,7 +217,7 @@ class Agent
#if defined(TEST) || defined(INFO)
*logofs << "Agent: proxyCanRead() is "
- << ((int) FD_ISSET(proxy -> getFd(), &readWorkSet)
+ << ((int) FD_ISSET(proxy -> getFd(), &readWorkSet))
<< ".\n" << logofs_flush;
#endif
diff --git a/nxcomp/ClearArea.cpp b/nxcomp/ClearArea.cpp
index 223a3b3e1..83b728158 100644
--- a/nxcomp/ClearArea.cpp
+++ b/nxcomp/ClearArea.cpp
@@ -92,7 +92,7 @@ void ClearAreaStore::dumpIdentity(const Message *message) const
ClearAreaMessage *clearArea = (ClearAreaMessage *) message;
- *logofs << name() << ": Identity exposures " << clearArea -> (unsigned int) exposures
+ *logofs << name() << ": Identity exposures " << (unsigned int) clearArea -> exposures
<< ", window " << clearArea -> window << ", x " << clearArea -> x
<< ", y " << clearArea -> y << ", width " << clearArea -> width
<< ", height " << clearArea -> height << ", size " << clearArea -> size_
diff --git a/nxcomp/Loop.cpp b/nxcomp/Loop.cpp
index 7bc154f36..f25aed353 100644
--- a/nxcomp/Loop.cpp
+++ b/nxcomp/Loop.cpp
@@ -1311,6 +1311,11 @@ void NXTransCleanup()
HandleCleanup();
}
+void NXTransCleanupForReconnect()
+{
+ HandleCleanupForReconnect();
+}
+
//
// Check the parameters for subsequent
// initialization of the NX transport.
@@ -4873,6 +4878,28 @@ int StartKeeper()
return 1;
}
+void HandleCleanupForReconnect()
+{
+ #ifdef TEST
+ *logofs << "Loop: Going to clean up system resources for Reconnect "
+ << "in process '" << getpid() << "'.\n"
+ << logofs_flush;
+ #endif
+ handleTerminatedInLoop();
+ DisableSignals();
+ if (control)
+ CleanupChildren();
+ CleanupListeners();
+ CleanupSockets();
+ CleanupKeeper();
+ CleanupStreams();
+ CleanupLocal();
+ CleanupGlobal();
+ RestoreSignals();
+ ServerCache::lastInitReply.set(0,NULL);
+ ServerCache::lastKeymap.set(0,NULL);
+ ServerCache::getKeyboardMappingLastMap.set(0,NULL);
+}
void HandleCleanup(int code)
{
#ifdef TEST
diff --git a/nxcomp/Misc.h b/nxcomp/Misc.h
index 21a503082..0cc396933 100644
--- a/nxcomp/Misc.h
+++ b/nxcomp/Misc.h
@@ -140,6 +140,7 @@ void HandleShutdown() __attribute__((noreturn));
extern "C"
{
void HandleCleanup(int code = 0) __attribute__((noreturn));
+ void HandleCleanupForReconnect();
}
//
diff --git a/nxcomp/NX.h b/nxcomp/NX.h
index 2dbf68662..0e4734e5f 100644
--- a/nxcomp/NX.h
+++ b/nxcomp/NX.h
@@ -442,6 +442,14 @@ extern int NXTransParseEnvironment(const char *env, int force);
extern void NXTransCleanup(void) __attribute__((noreturn));
+/*
+ * Cleans up the global and local state
+ * (the same way as NXTransCleanup does)
+ * but does not exit the process
+ * Needed for IOS platform
+ */
+extern void NXTransCleanupForReconnect(void);
+
extern const char* NXVersion();
extern int NXMajorVersion();
extern int NXMinorVersion();
diff --git a/nxcomp/Proxy.cpp b/nxcomp/Proxy.cpp
index 9b38661b4..4eb99cf45 100644
--- a/nxcomp/Proxy.cpp
+++ b/nxcomp/Proxy.cpp
@@ -5176,7 +5176,7 @@ char *Proxy::handleSaveAllStores(const char *savePath) const
*(cacheDumpName + DEFAULT_STRING_LENGTH - 1) = '\0';
- mode_t fileMode = umask(0077);
+ fileMode = umask(0077);
cacheDump = new ofstream(cacheDumpName, ios::out);