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

BUG #1467: fe_connect doesn't handle EINTR right

From: "Florian Hars" <hars(at)bik-gmbh(dot)de>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1467: fe_connect doesn't handle EINTR right
Date: 2005-02-07 12:06:13
Message-ID: (view raw or whole thread)
Lists: pgsql-bugspgsql-hackers
The following bug has been logged online:

Bug reference:      1467
Logged by:          Florian Hars
Email address:      hars(at)bik-gmbh(dot)de
PostgreSQL version: 8.0.1
Operating system:   All
Description:        fe_connect doesn't handle EINTR right

The file pgsql/src/interfaces/libpq/fe-connect.c contains the code fragment

  if (connect(conn->sock, addr_cur->ai_addr,
	                  addr_cur->ai_addrlen) < 0)
	/* Interrupted system call - just try again */
		goto retry_connect;

This is not in accordance with a strict legalistic reading of the POSIX
spec, according to which connect is not restartable so that you have to use
select or poll after connect returned with EINTR.

for the ugly details, your code should work on Linux, but not on Solaris or


pgsql-hackers by date

Next:From: Kenneth MarshallDate: 2005-02-07 14:14:28
Subject: Re: Thinking about breaking up the BufMgrLock
Previous:From: Simon RiggsDate: 2005-02-07 08:28:09
Subject: Re: Inline MemoryContextSwitchTo?

pgsql-bugs by date

Next:From: Tobias BroxDate: 2005-02-07 14:34:57
Subject: BUG #1468: psql_dump is not backward compatible
Previous:From: Kris JurkaDate: 2005-02-07 09:30:20
Subject: Re: timezone offsets and documentation

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