AF:
NF:0
PS:10
SRH:1
SFN:
DSR:
MID:
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
RMID:#imap/andys@onstor.net@exch1.onstor.net/INBOX	0	2779531E7C760D4491C96305019FEEB5175C0F54B7@exch1.onstor.net
X-Sylpheed-End-Special-Headers: 1
Date: Thu, 6 Nov 2008 17:05:17 -0800
From: Andrew Sharp <andy.sharp@onstor.com>
To: Maxim Kozlovsky <maxim.kozlovsky@onstor.com>
Subject: Re: strncmp somehow snuck back into exim patch
Message-ID: <20081106170517.43693fea@ripper.onstor.net>
In-Reply-To: <2779531E7C760D4491C96305019FEEB5175C0F54B7@exch1.onstor.net>
References: <20081106164241.031009c2@ripper.onstor.net>
	<2779531E7C760D4491C96305019FEEB5175C0F54B7@exch1.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

OK, thanks.

On Thu, 6 Nov 2008 16:48:27 -0800 Maxim Kozlovsky
<maxim.kozlovsky@onstor.com> wrote:

> The code looks ok, the forked child should call rmc_init_ex() and
> should not call rmc_shutdown(). Rmc_shutdown() will close the
> parent's sessions which is not what we want to do. There is some code
> in rmc_init_ex() which deals specifically with the forked child case.
> 
> >-----Original Message-----
> >From: Andy Sharp
> >Sent: Thursday, November 06, 2008 4:43 PM
> >To: Maxim Kozlovsky
> >Subject: strncmp somehow snuck back into exim patch
> >
> >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;
> > }
