This is an automated email from the git hooks/post-receive script. x2go pushed a commit to branch bugfix/osx in repository x2goclient. commit 86baec24050790c6372a6606cc82f54d45093dac 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 446cec6..a04d80f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -83,6 +83,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. [ Mike Gabriel ] * debian/control: 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