[X2Go-Commits] [x2goclient] 216/217: src/unixhelper.cpp: code cleanup.

2016-09-20 Thread git-admin
This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch bugfix/osx
in repository x2goclient.

commit fe3eae7074131fbb9e0585fe5f176f3c6e6c69be
Author: Mihai Moldovan 
Date:   Sat Aug 13 23:33:15 2016 +0200

src/unixhelper.cpp: code cleanup.
---
 debian/changelog   |1 +
 src/unixhelper.cpp |   14 +-
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 3d1e696..0a97c9a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -370,6 +370,7 @@ x2goclient (4.0.5.3-0x2go1) UNRELEASED; urgency=medium
   cleanup process doesn't kill itself before all other processes in the
   process group are killed.
 - src/pulsemanager.cpp: remove unused variables.
+- src/unixhelper.cpp: code cleanup.
 
  -- X2Go Release Manager   Mon, 19 Sep 2016 09:07:07 +0200
 
diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp
index 82e4374..d6b4993 100644
--- a/src/unixhelper.cpp
+++ b/src/unixhelper.cpp
@@ -31,7 +31,6 @@
 #include 
 #include 
 #include 
-#include 
 
 /* For documentation please see unixhelper.h. */
 
@@ -60,8 +59,8 @@ namespace unixhelper {
   }
   /* Error. */
   else if (-1 == tmp_pid) {
-perror ("WARNING: unable to fork off another process to kill original 
process group");
-std::cerr << "Proceeding with normal operation, but  process might 
kill itself before tree vanishes." << std::endl;
+std::perror ("WARNING: unable to fork off another process to kill 
original process group");
+std::cerr << "Proceeding with normal operation, but process might kill 
itself before tree vanishes." << std::endl;
 
 real_kill_pgroup (pgid_to_kill);
   }
@@ -72,7 +71,7 @@ namespace unixhelper {
  * spawn a bunch of new processes due to subsequent calls
  * to kill_pgroup () from unix_cleanup ().
  */
-exit (EXIT_SUCCESS);
+std::exit (EXIT_SUCCESS);
   }
 }
   }
@@ -96,13 +95,10 @@ namespace unixhelper {
  * Let's handle errors and exit, if necessary.
  */
 if (0 != kill_ret) {
-  char err_str[512] = { };
-  snprintf (err_str, 512, "WARNING: failed to kill process group '%d'", 
pgid);
-
-  perror (err_str);
+  std::cerr << "WARNING: failed to kill process group '" << pgid << "': " 
<< std::strerror (err_str) << std::endl;
 }
 
-exit (EXIT_SUCCESS);
+std::exit (EXIT_SUCCESS);
   }
 
   int unix_cleanup (const pid_t parent) {

--
Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email 
on /srv/git/code.x2go.org/x2goclient.git
___
x2go-commits mailing list
x2go-commits@lists.x2go.org
http://lists.x2go.org/listinfo/x2go-commits


[X2Go-Commits] [x2goclient] 216/217: src/unixhelper.cpp: code cleanup.

2016-08-27 Thread git-admin
This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch bugfix/osx
in repository x2goclient.

commit 844e7681de3f93f48516f69c5839a5fc7aeb9b50
Author: Mihai Moldovan 
Date:   Sat Aug 13 23:33:15 2016 +0200

src/unixhelper.cpp: code cleanup.
---
 debian/changelog   |1 +
 src/unixhelper.cpp |   14 +-
 2 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index b6dec3e..09aeb4f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -403,6 +403,7 @@ x2goclient (4.0.5.2-0x2go1) UNRELEASED; urgency=medium
   cleanup process doesn't kill itself before all other processes in the
   process group are killed.
 - src/pulsemanager.cpp: remove unused variables.
+- src/unixhelper.cpp: code cleanup.
   * debian/control:
 - Maintainer change in package: X2Go Developers .
 - Uploaders: add myself. Also, force a rebuild due to the changed
diff --git a/src/unixhelper.cpp b/src/unixhelper.cpp
index 82e4374..d6b4993 100644
--- a/src/unixhelper.cpp
+++ b/src/unixhelper.cpp
@@ -31,7 +31,6 @@
 #include 
 #include 
 #include 
-#include 
 
 /* For documentation please see unixhelper.h. */
 
@@ -60,8 +59,8 @@ namespace unixhelper {
   }
   /* Error. */
   else if (-1 == tmp_pid) {
-perror ("WARNING: unable to fork off another process to kill original 
process group");
-std::cerr << "Proceeding with normal operation, but  process might 
kill itself before tree vanishes." << std::endl;
+std::perror ("WARNING: unable to fork off another process to kill 
original process group");
+std::cerr << "Proceeding with normal operation, but process might kill 
itself before tree vanishes." << std::endl;
 
 real_kill_pgroup (pgid_to_kill);
   }
@@ -72,7 +71,7 @@ namespace unixhelper {
  * spawn a bunch of new processes due to subsequent calls
  * to kill_pgroup () from unix_cleanup ().
  */
-exit (EXIT_SUCCESS);
+std::exit (EXIT_SUCCESS);
   }
 }
   }
@@ -96,13 +95,10 @@ namespace unixhelper {
  * Let's handle errors and exit, if necessary.
  */
 if (0 != kill_ret) {
-  char err_str[512] = { };
-  snprintf (err_str, 512, "WARNING: failed to kill process group '%d'", 
pgid);
-
-  perror (err_str);
+  std::cerr << "WARNING: failed to kill process group '" << pgid << "': " 
<< std::strerror (err_str) << std::endl;
 }
 
-exit (EXIT_SUCCESS);
+std::exit (EXIT_SUCCESS);
   }
 
   int unix_cleanup (const pid_t parent) {

--
Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email 
on /srv/git/code.x2go.org/x2goclient.git
___
x2go-commits mailing list
x2go-commits@lists.x2go.org
http://lists.x2go.org/listinfo/x2go-commits