1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-12 05:01:15 +03:00

Move non-blocking code into its own /port file, for code clarity.

This commit is contained in:
Bruce Momjian
2004-03-10 21:12:49 +00:00
parent ae22a6c185
commit 60a068b389
8 changed files with 53 additions and 39 deletions

View File

@@ -13,7 +13,7 @@
*
* Copyright (c) 2001-2003, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.59 2004/03/09 05:11:52 momjian Exp $
* $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.60 2004/03/10 21:12:46 momjian Exp $
* ----------
*/
#include "postgres.h"
@@ -327,7 +327,7 @@ pgstat_init(void)
* messages will be discarded; backends won't block waiting to send
* messages to the collector.
*/
if (FCNTL_NONBLOCK(pgStatSock) < 0)
if (!set_noblock(pgStatSock))
{
ereport(LOG,
(errcode_for_socket_access(),
@@ -1819,7 +1819,7 @@ pgstat_recvbuffer(void)
* Set the write pipe to nonblock mode, so that we cannot block when
* the collector falls behind.
*/
if (FCNTL_NONBLOCK(writePipe) < 0)
if (!set_noblock(writePipe))
{
ereport(LOG,
(errcode_for_socket_access(),