Re: pg_ctl.c - Mailing list pgsql-patches

From Gaetano Mendola
Subject Re: pg_ctl.c
Date
Msg-id 40B4C95C.2070500@bigfoot.com
Whole thread Raw
In response to Re: pg_ctl.c  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: pg_ctl.c  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-patches
Andrew Dunstan wrote:

> Gaetano Mendola wrote:
>
>> Bruce Momjian wrote:
>>
>> however below the result of my quich review:
>>
>> 1) exit(1)  => exit(EXIT_FAILURE)
>
>
>
> If we used a number of different error codes I might agree. But it seems
> pointless here, and the style is widely used in our code base (I just
> counted 201 other occurrrences, not including cases of exit(0) ).

This doesn't mean that we don't have to.


>> 2) xstrdup protected by duplicate NULL string
> I don't object, but it is redundant - in every case where it is called
> the argument is demonstrably not NULL.

Now it's true, and in the future ? Bruce was arguing about that check
that if the string is null the program simply will exit crashing!
I really appreciate the quality software of Postgres but some time
I don't understand why test "NULL" pointer is an overkill for you.
I mean xstrdup is supposed to be the strdup safe version, and without
that control is not safe, why don't use directly the strdup then ?
If there is no memory available before postgresql start go figure after!



Regards
Gaetano Mendola













pgsql-patches by date:

Previous
From: Tom Lane
Date:
Subject: Re: Small patch for oracle_compat.c
Next
From: Andrew Dunstan
Date:
Subject: Re: pg_ctl.c