This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 9e85ce10e5c3393368fcda248649fc62f06a54ea Author: Mihai Moldovan <ionic@ionic.de> Date: Mon Mar 16 22:15:58 2015 +0100 unixhelper.cpp: kill process group on error. --- debian/changelog | 1 + src/unixhelper.cpp | 10 +++++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/debian/changelog b/debian/changelog index 7e2ed68..8a3c78b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -22,6 +22,7 @@ x2goclient (4.0.4.1-0x2go1) UNRELEASED; urgency=low (module) namespace, not a class. - unixhelper.{cpp,h}: add documentation/comments. - x2goclient.cpp: return return value of unixhelper::unix_cleanup(). + - unixhelper.cpp: kill process group on error. -- X2Go Release Manager <git-admin@x2go.org> Tue, 26 May 2015 21:42:09 +0200 diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp index 2ad0740..d9ef3d7 100644 --- a/src/unixhelper.cpp +++ b/src/unixhelper.cpp @@ -28,13 +28,17 @@ #include <iostream> #include <cstring> #include <cerrno> -#include <cstdlib> /* For documentation please see unixhelper.h. */ namespace unixhelper { void kill_pgroup (int signal) { - if (SIGHUP == signal) { + if ((SIGHUP == signal) || (-1 == signal)) { + if (-1 == signal) { + std::cerr << "ERROR: emergency exit due to previous error(s)." << "\n"; + std::cerr << "Please report a bug, refer to this documentation: http://wiki.x2go.org/doku.php/wiki:bugs" << std::endl; + } + /* Try to kill via SIGTERM first. */ if (0 != killpg (getpgrp (), SIGTERM)) { std::cerr << "WARNING: unable to send SIGTERM to process group: " << std::strerror (errno) << std::endl; @@ -52,7 +56,7 @@ namespace unixhelper { int unix_cleanup () { if (SIG_ERR == std::signal (SIGTERM, SIG_IGN)) { std::cerr << "Unable to ignore SIGTERM: " << std::strerror (errno) << std::endl; - std::exit (1); + kill_pgroup (-1); /* Anything here shall be unreachable. */ } -- Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email on /srv/git/code.x2go.org/x2goclient.git