eventscript: don't do debugging system() from inside signal handler
[metze/ctdb/wip.git] / common / ctdb_util.c
index 63abc02437820b78ca313a3284c3eaecfdc7eb76..433a2ad8578b29421449984c6af44814f6666af7 100644 (file)
@@ -339,6 +339,18 @@ void ctdb_high_priority(struct ctdb_context *ctdb)
        }
 }
 
+/*
+  make ourselves slightly nicer: eg. a ctdb child.
+ */
+void ctdb_reduce_priority(struct ctdb_context *ctdb)
+{
+       errno = 0;
+       if (nice(10) == -1 && errno != 0) {
+               DEBUG(DEBUG_WARNING,("Unable to lower priority: %s\n",
+                                    strerror(errno)));
+       }
+}
+
 void set_nonblocking(int fd)
 {
        unsigned v;