Re: [bug fix] pg_ctl always uses the same event source - Mailing list pgsql-hackers

From MauMau
Subject Re: [bug fix] pg_ctl always uses the same event source
Date
Msg-id D952BB44B71341A9B8FCB8E09E5CA108@maumau
Whole thread Raw
In response to Re: [bug fix] pg_ctl always uses the same event source  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: [bug fix] pg_ctl always uses the same event source
List pgsql-hackers
From: "Amit Kapila" <amit.kapila16@gmail.com>
> Few minor things:
> 1.
> evtHandle = RegisterEventSource(NULL,
> *event_source? event_source: DEFAULT_EVENT_SOURCE);
>
> In this code, you are trying to access the value (*event_source) and
> incase it is not initialised,
> it will not contain the value and could cause problem, why not
> directly check 'event_source'?

event_source here is a global static char array, so it's automatically
initialized with zeros and safe to access.


> 2. minor coding style issue
> pg_ctl.c
> evtHandle = RegisterEventSource(NULL,
> *event_source? event_source: DEFAULT_EVENT_SOURCE);
>
> elog.c
> ! evtHandle = RegisterEventSource(NULL,
> ! event_source ? event_source : DEFAULT_EVENT_SOURCE);
>
> In both above usages, it is better that arguments in second line should
> start
> inline with previous lines first argument. You can refer other places,
> for ex. refer call to ReportEvent in pg_ctl.c just below
> RegisterEventSource call.

Thanks.  I passed the source files through pgindent and attached the revised
patch.  Although the arguments in the second line are not in line with the
first line's arguments, that's what pgindent found good.

Regards
MauMau

Attachment

pgsql-hackers by date:

Previous
From: KONDO Mitsumasa
Date:
Subject: Re: Optimize kernel readahead using buffer access strategy
Next
From: "MauMau"
Date:
Subject: [bug fix] connection service file doesn't take effect with ECPG apps