Re: gettext calls in pgport

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: gettext calls in pgport
Дата
Msg-id 41740F57.3060702@dunslane.net
обсуждение исходный текст
Ответ на Re: gettext calls in pgport  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: gettext calls in pgport  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: gettext calls in pgport  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers

Tom Lane wrote:

>Somebody just yesterday stuck an
>"fprintf(stderr,...); exit(1)" into one of the pgport routines.  This
>sucks, but there is not a lot else that can be done if the code needs
>to exist in both backend and clients.  It'd be better to propagate the
>error condition back to the caller.
>
>An alternative possibility is to stop pretending that pgport is agnostic
>about whether it is in backend or frontend.  This might mean some
>duplication of code between src/port/ and src/backend/port/, but if
>that's what it takes to have sane error handling, that's what we should do.
>
>
>  
>

Maybe you're referring to the patch I sent in to strip the .exe suffix 
in get_progname? ;-)

I wondered about that. The choices on strdup() error seemed to be:

. ignore the error and return the unstripped path, knowing the program 
would fail in a minute on the next malloc call anyway
. return NULL and patch the code in about 20 places (of which one is the 
backend) where get_progname() is called
. print a message and exit

I can see arguments for all of these ;-)

cheers

andrew




В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Final libpq patch?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: gettext calls in pgport