From fd05f896455c62104c1134b06f528858dcb4e7c3 Mon Sep 17 00:00:00 2001
From: Peter Eisentraut <peter_e@gmx.net>
Date: Tue, 21 Nov 2000 23:03:54 +0000
Subject: [PATCH] Extend accept/AF_UNIX bug workaround to SCO OpenServer.

---
 src/backend/libpq/pqcomm.c  | 8 ++++----
 src/include/port/sco.h      | 3 +++
 src/include/port/unixware.h | 2 +-
 3 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/src/backend/libpq/pqcomm.c b/src/backend/libpq/pqcomm.c
index 9ff33694904..d680cfb7d51 100644
--- a/src/backend/libpq/pqcomm.c
+++ b/src/backend/libpq/pqcomm.c
@@ -29,7 +29,7 @@
  * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- *	$Id: pqcomm.c,v 1.112 2000/11/14 01:15:00 momjian Exp $
+ *	$Id: pqcomm.c,v 1.113 2000/11/21 23:03:53 petere Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -411,10 +411,10 @@ StreamConnection(int server_fd, Port *port)
 		return STATUS_ERROR;
 	}
 
-#ifdef PG_ON_UNIXWARE
+#ifdef SCO_ACCEPT_BUG
 	/*
-	 * Only UnixWare 7+ are known to have this bug, but it shouldn't
-	 * hurt it catch if for all of them.
+	 * UnixWare 7+ and OpenServer 5.0.4 are known to have this bug,
+	 * but it shouldn't hurt it catch if for all of them.
 	 */
 	if (port->raddr.sa.sa_family == 0)
 		port->raddr.sa.sa_family = AF_UNIX;
diff --git a/src/include/port/sco.h b/src/include/port/sco.h
index b37990c3dd9..1e08b5b8a5c 100644
--- a/src/include/port/sco.h
+++ b/src/include/port/sco.h
@@ -4,6 +4,9 @@
 
 #define DISABLE_COMPLEX_MACRO
 
+/* see src/backend/libpq/pqcomm.c */
+#define SCO_ACCEPT_BUG
+
 #define HAS_TEST_AND_SET
 #define NEED_I386_TAS_ASM
 
diff --git a/src/include/port/unixware.h b/src/include/port/unixware.h
index 76d5f26d88b..7a622c83a99 100644
--- a/src/include/port/unixware.h
+++ b/src/include/port/unixware.h
@@ -2,7 +2,7 @@
 #define NEED_I386_TAS_ASM
 
 /* see src/backend/libpq/pqcomm.c */
-#define PG_ON_UNIXWARE
+#define SCO_ACCEPT_BUG
 
 /***************************************
  * Define this if you are compiling with
-- 
GitLab