From: | "MauMau" <maumau307(at)gmail(dot)com> |
---|---|
To: | "Amit Kapila" <amit(dot)kapila16(at)gmail(dot)com> |
Cc: | "Magnus Hagander" <magnus(at)hagander(dot)net>, "PostgreSQL-development" <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: [bug fix] pg_ctl always uses the same event source |
Date: | 2013-12-17 12:03:38 |
Message-ID: | D952BB44B71341A9B8FCB8E09E5CA108@maumau |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
From: "Amit Kapila" <amit(dot)kapila16(at)gmail(dot)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 | Content-Type | Size |
---|---|---|
pg_ctl_eventsrc_v3.patch | application/octet-stream | 7.9 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | MauMau | 2013-12-17 12:26:49 | [bug fix] connection service file doesn't take effect with ECPG apps |
Previous Message | KONDO Mitsumasa | 2013-12-17 11:50:06 | Re: Optimize kernel readahead using buffer access strategy |