Skip site navigation (1) Skip section navigation (2)

Re: BeOS take 2

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: david(at)jetnet(dot)co(dot)uk
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: BeOS take 2
Date: 2000-06-09 15:26:40
Message-ID: 19026.960564400@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-patches
"David Reid" <david(at)jetnet(dot)co(dot)uk> writes:
> Looking at the code in pqcomm.c|h should a new define of 
> NO_UNIX_SOCKETS be defined to clean up the defines around the unix 
> socket code?

Yes, I was thinking that would be a good idea even before you sent
this patch.  We already have QNX and WIN wanting to ifdef out
the unix-domain socket code, so it's time to make an OS-independent
name for that compilation flag.

I'm not sure if HAVE_SYS_UN_H is an appropriate way of testing
for it or not (I see you did it that way in a couple of places).
I'd rather make a new symbol HAVE_UNIX_SOCKETS, I think, and
ifdef the code on that basis.

Also, I object to coding like

  	saddr.sa.sa_family = family;
  	if (family == AF_UNIX)
  	{
+ #ifdef HAVE_SYS_UN_H /* we have unix sockets */
  		len = UNIXSOCK_PATH(saddr.un, portName);
  		strcpy(sock_path, saddr.un.sun_path);
! #endif
  		/*
  		 * If the socket exists but nobody has an advisory lock on it we
  		 * can safely delete the file.

If you are going to break the socket code path then you ought to disable
it completely, ie the whole "if (family == AF_UNIX)" path ought to be
commented out so that control must go to the TCP path.  Falling through
a nonfunctional code path is not a good idea.

			regards, tom lane

In response to

Responses

pgsql-patches by date

Next:From: Bruce MomjianDate: 2000-06-09 15:50:30
Subject: Re: NO-CREATE-TABLE and NO-LOCK-TABLE
Previous:From: Tom LaneDate: 2000-06-09 15:18:04
Subject: Re: Patch for more readable parse error messages

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group