[X2Go-Commits] [nx-libs] 43/54: nxdialog: allow to provide --parent 0 for testing

git-admin at x2go.org git-admin at x2go.org
Sun Mar 24 10:05:06 CET 2019


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch master
in repository nx-libs.

commit 07052a25c0295806b50cf52191f98986b40e8b38
Author: Ulrich Sibiller <ulrich.sibiller at atos.net>
Date:   Fri Mar 1 10:50:16 2019 +0100

    nxdialog: allow to provide --parent 0 for testing
    
    Agent PID 0 can be used for testing
---
 nxdialog/nxdialog | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/nxdialog/nxdialog b/nxdialog/nxdialog
index 58e773c..d3a7c0b 100755
--- a/nxdialog/nxdialog
+++ b/nxdialog/nxdialog
@@ -234,11 +234,13 @@ def handle_session_action(agentpid, action):
 
     if action == DISCONNECT:
         print("Disconnecting from session, sending SIGHUP to %s" % (agentpid))
-        os.kill(agentpid, signal.SIGHUP)
+        if agentpid != 0:
+            os.kill(agentpid, signal.SIGHUP)
 
     elif action == TERMINATE:
         print("Terminating session, sending SIGTERM to process %s" % (agentpid))
-        os.kill(agentpid, signal.SIGTERM)
+        if agentpid != 0:
+            os.kill(agentpid, signal.SIGTERM)
 
     elif action is None:
         pass
@@ -339,7 +341,7 @@ class NxDialogProgram(object):
 
         if dlgtype in (DLG_TYPE_PULLDOWN,
                        DLG_TYPE_YESNOSUSPEND,
-                       DLG_TYPE_YESNO) and not self.options.agentpid:
+                       DLG_TYPE_YESNO) and self.options.agentpid is None:
             sys.stderr.write("Agent pid not supplied via --parent\n")
             sys.exit(EXIT_FAILURE)
 

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git


More information about the x2go-commits mailing list