util: Call setproctitle() if available.
authorAndreas Schneider <asn@samba.org>
Wed, 6 Mar 2013 08:30:37 +0000 (09:30 +0100)
committerAndreas Schneider <asn@samba.org>
Wed, 12 Jun 2013 07:49:41 +0000 (09:49 +0200)
lib/util/util_process.c

index 6036e27c124e2dd0680e3c4035158427d485c30b..3c8531785fc5ead613e28618faf1209526ebceac 100644 (file)
@@ -19,6 +19,8 @@
  *  along with this program; if not, see <http://www.gnu.org/licenses/>.
  */
 
+#include "includes.h"
+
 #include "util_process.h"
 
 #ifdef HAVE_SYS_PRCTL_H
@@ -29,6 +31,8 @@ int prctl_set_comment(const char *comment)
 {
 #if defined(HAVE_PRCTL) && defined(PR_SET_NAME)
        return prctl(PR_SET_NAME, (unsigned long) comment, 0, 0, 0);
+#elif defined(HAVE_SETPROCTITLE)
+       setproctitle("%s", comment);
 #endif
        return 0;
 }