[Xfce4-commits] [panel-plugins/xfce4-hardware-monitor-plugin] 54/96: Report on failure of nice command - avoids compilation warning
noreply at xfce.org
noreply at xfce.org
Thu Nov 27 22:20:59 CET 2014
This is an automated email from the git hooks/post-receive script.
nick pushed a commit to branch master
in repository panel-plugins/xfce4-hardware-monitor-plugin.
commit d28b946382618764dc0f1b264c27943f87fc02fa
Author: OmegaPhil <OmegaPhil at gmail.com>
Date: Tue Jan 21 19:50:34 2014 +0000
Report on failure of nice command - avoids compilation warning
---
src/applet.cpp | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/applet.cpp b/src/applet.cpp
index d89190f..d97587e 100644
--- a/src/applet.cpp
+++ b/src/applet.cpp
@@ -28,7 +28,9 @@
#include <gtkmm/main.h>
#include <cassert>
-#include <unistd.h> // for nice
+#include <cerrno> // Dealing with nice error
+#include <cstring> // Dealing with nice error
+#include <unistd.h> // For nice
#include <libgnomecanvasmm/init.h>
extern "C"
@@ -50,10 +52,16 @@ extern "C"
#include "preferences-window.hpp"
#include "i18n.hpp"
+
// XFCE4 functions to create and destroy applet
extern "C" void applet_construct(XfcePanelPlugin* plugin)
{
- nice(5); // Don't eat up too much CPU
+ // Don't eat up too much CPU
+ if (nice(5) == -1)
+ {
+ std::cerr << "Unable to nice hardware-monitor-applet: %s" <<
+ std::strerror(errno) << "\n";
+ }
try {
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list