AF:
NF:0
PS:10
SRH:1
SFN:
DSR:
MID:<20081106163916.52651596@ripper.onstor.net>
CFG:
PT:0
S:andy.sharp@onstor.com
RQ:
SSV:exch1.onstor.net
NSV:
SSH:
R:<maxim.kozlovsky@onstor.com>
MAID:1
X-Sylpheed-Privacy-System:
X-Sylpheed-Sign:0
SCF:#mh/Mailbox/sent
X-Sylpheed-End-Special-Headers: 1
Date: Thu, 6 Nov 2008 16:42:41 -0800
From: Andrew Sharp <andy.sharp@onstor.com>
To: Maxim Kozlovsky <maxim.kozlovsky@onstor.com>
Subject: strncmp somehow snuck back into exim patch
Message-ID: <20081106164241.031009c2@ripper.onstor.net>
Organization: Onstor
X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.8.20; x86_64-pc-linux-gnu)
Mime-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit

Hi Max,

Well, it looks like I somehow screwed up, possibly copied the old patch
onto the new patch instead of the right way around, and the broken
strncmp was still in there, which has to be the cause of this latest
stuck exim problem.

I was looking at the function I wrote in dns.c, and I was wondering if
you could check/verify the logic, because I'm just not sure it's
correct.  I copied it below.  Should it really call rmc_init_ex() if all
it did was fork?  Can't the forked child use/share the already set up
RMC context?  If it should reinitialize it, is this the right way to do
it, or should it do an rmc_shutdown() followed by and rmc_init_ex()
instead?

 int
 onstor_get_mgmt_vsid(void)
 {
	static int vsid = -1;
	static char proc_name[16];
	char new_proc_name[16];

	/*
	 * this rmc init function must be called by every thread
	 * that uses rmc, whether it knows it or not.
	 *
	 * on top of that, if fork() has been called since the last
	 * call to rmc_init_ex, it must be called again.
	 */
	sprintf(new_proc_name, "exim4-%d", getpid());
	if (strcmp(proc_name, new_proc_name)) {
		strcpy(proc_name, new_proc_name);
		rmc_init_ex(proc_name, 0x1020000LL, NULL);
	}
	if (vsid == -1) {
		vsid = cluster_getVsMgmtId();
	}

	return vsid;
 }
