[PATCH] Fix default value for enable_environment_macros

Ton Voon tonvoon at gmail.com
Tue Jan 15 10:05:44 CET 2013


Hi Andreas,

On 14 Jan 2013, at 10:08, Andreas Ericsson wrote:

> On 01/14/2013 10:30 AM, Ton Voon wrote:
>> What I can't work out is how to set the env property in "define command". Can you provide some pointers and assistance?
>> 
> Using a secondary list of key/value vectors. Since commands are usually
> fewer than 500 and remain pretty static, I'd just use a command->id
> indexed pointer-to-pointer list of key value vectors.

I couldn't work out how to create this array. I modelled it on command_ary, but it kept segfaulting when setting this first array element. I'm sure there's a malloc required somewhere, but I couldn't see how command_ary was being initialised. In the end, I've extended the command object to include an env attribute.

The next problem is that with an arbitrary list of environment variables, I need to pass this to the worker job creator. I can't see how to extend the wproc_* jobs, but it looks like the nagios_macros are not used. So I propose that we change:

static int wproc_run_job(worker_job *job, nagios_macros *mac)

to

static int wproc_run_job(worker_job *job, char **env)

Is this acceptable?

Ton


------------------------------------------------------------------------------
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512




More information about the Developers mailing list