Re: Re: UUNET socket-file-location patch

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Re: UUNET socket-file-location patch
Date: 2000-11-22 01:37:51
Message-ID: 200011220137.UAA18253@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers pgsql-hackers

> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> >> Peter Eisentraut <peter_e(at)gmx(dot)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
>

OK, here is the diff to make the socket file option specify just a
directory, not a full path. Documentation changes were also made.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

Attachment Content-Type Size
unknown_filename text/plain 2.9 KB

In response to

Browse pgsql-committers by date

  From Date Subject
Next Message momjian 2000-11-22 01:41:13 pgsql/doc/src/sgml (libpq++.sgml libpq.sgml runtime.sgml)
Previous Message Tom Lane 2000-11-22 01:14:18 Re: [COMMITTERS] pgsql/contrib/pg_dumplo (README.pg_dumplo lo_export.c lo_import.c main.c pg_dumplo.h utils.c)

Browse pgsql-hackers by date

  From Date Subject
Next Message Philip Warner 2000-11-22 01:45:30 Re: Assert Failure with current CVS
Previous Message Mikheev, Vadim 2000-11-22 01:37:25 RE: Crash during WAL recovery?