dovecot-2.0: Added process title hack support for OS X.

dovecot at dovecot.org dovecot at dovecot.org
Thu May 20 18:16:42 EEST 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/348eb4754085
changeset: 11356:348eb4754085
user:      Timo Sirainen <tss at iki.fi>
date:      Thu May 20 17:16:39 2010 +0200
description:
Added process title hack support for OS X.

diffstat:

 configure.in            |  2 +-
 src/lib/process-title.c |  6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diffs (31 lines):

diff -r ef1de95396d4 -r 348eb4754085 configure.in
--- a/configure.in	Thu May 20 13:35:38 2010 +0200
+++ b/configure.in	Thu May 20 17:16:39 2010 +0200
@@ -633,7 +633,7 @@
 		LIBS="-lxnet $LIBS"
 		AC_DEFINE(PREAD_BROKEN,, Defint if pread/pwrite implementation is broken)
 		;;
-	linux*)
+	linux*|darwin*)
 		AC_DEFINE(PROCTITLE_HACK,, Define if process title can be changed by modifying argv)
 		;;
 	*)
diff -r ef1de95396d4 -r 348eb4754085 src/lib/process-title.c
--- a/src/lib/process-title.c	Thu May 20 13:35:38 2010 +0200
+++ b/src/lib/process-title.c	Thu May 20 17:16:39 2010 +0200
@@ -89,11 +89,13 @@
 {
 	size_t len = strlen(title);
 
-	if (len >= process_title_len)
-		len = process_title_len - 1;
+	/* OS X wants two NULs */
+	if (len >= process_title_len-1)
+		len = process_title_len - 2;
 
 	memcpy(process_title, title, len);
 	process_title[len++] = '\0';
+	process_title[len++] = '\0';
 
 	if (len < process_title_clean_pos) {
 		memset(process_title + len, PROCTITLE_CLEAR_CHAR,


More information about the dovecot-cvs mailing list