Re: Re: UUNET socket-file-location patch

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Re: UUNET socket-file-location patch
Дата
Msg-id 11839.974262532@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Re: UUNET socket-file-location patch  (Bruce Momjian <pgman@candle.pha.pa.us>)
Ответы Re: Re: UUNET socket-file-location patch  (Bruce Momjian <pgman@candle.pha.pa.us>)
Re: Re: UUNET socket-file-location patch  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
>> Peter Eisentraut <peter_e@gmx.net> writes:
>>>> Should the parameter determine the directory or the full file name?  I'd
>>>> go for the former, but it's not a strong case.
>> 
>> Directory was what I had in mind too, but I'm not sure what Bruce
>> actually did ...

> I did whatever the patch did.  I believe it is the full path.  I believe
> it is used here:

> #define UNIXSOCK_PATH(sun,port,defpath) \
>         ((defpath && defpath[0] != '\0') ? (strncpy((sun).sun_path,
> defpath, sizeof((sun).sun_path)),
> (sun).sun_path[sizeof((sun).sun_path)-1] = '\0') :
> sprintf((sun).sun_path, "/tmp/.s.PGSQL.%d", (port)))

Hmm.  I think it would make more sense to make the parameter be just
the directory, not the full path including filename --- for one thing,
doing it like that renders the port-number parameter useless.  Why not

#define UNIXSOCK_PATH(sun,port,defpath) \   snprintf((sun).sun_path, sizeof((sun).sun_path), "%s/.s.PGSQL.%d", \
   (((defpath) && *(defpath) != '\0') ? (defpath) : "/tmp"), \            (port))
 
        regards, tom lane


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Details for planned template0/template1 change
Следующее
От: igor
Дата:
Сообщение: One more 486 Optimizations...