Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aHZ8E-0002DB-6D for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Jan 2016 15:39:14 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aHZ8D-00019l-Ld for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Jan 2016 15:39:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aHZ8C-00018o-Ep for pgsql-hackers@postgresql.org; Fri, 08 Jan 2016 15:39:12 +0000 Received: from out.smtp-auth.no-ip.com ([8.23.224.60]) by magus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1aHZ87-0003w8-Ls for pgsql-hackers@postgresql.org; Fri, 08 Jan 2016 15:39:11 +0000 X-No-IP: alvh.no-ip.org@noip-smtp X-Report-Spam-To: abuse@no-ip.com Received: from alvin.alvh.no-ip.org (unknown [200.104.53.52]) (Authenticated sender: alvh.no-ip.org@noip-smtp) by smtp-auth.no-ip.com (Postfix) with ESMTPA id 040F7401132; Fri, 8 Jan 2016 07:39:05 -0800 (PST) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id E7522580; Fri, 8 Jan 2016 12:39:02 -0300 (CLT) Date: Fri, 8 Jan 2016 12:39:02 -0300 From: Alvaro Herrera To: Tom Lane Cc: Michael Paquier , pgsql-hackers@postgresql.org, Marco Atzeri Subject: Re: [COMMITTERS] pgsql: Blind attempt at a Cygwin fix Message-ID: <20160108153902.GA589413@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="EeQfGwPcQSOJBaQU" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20160108151331.GA584390@alvherre.pgsql> User-Agent: Mutt/1.5.23 (2014-03-12) X-Pg-Spam-Score: -1.1 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org --EeQfGwPcQSOJBaQU Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit Alvaro Herrera wrote: > Tom Lane wrote: > > Alvaro Herrera writes: > > > Blind attempt at a Cygwin fix > > > > According to > > http://buildfarm.postgresql.org/cgi-bin/show_log.pl?nm=brolga&dt=2016-01-08%2014%3A51%3A27 > > > > brolga now tries to compile win32security.c, which it evidently was not > > doing before, but the compile blows up; looks like it is missing #include > > calls (which must exist in other places where this code lives ...) > > Obviously this wasn't the best idea ever. Andrew suggests on IM to > revert this on Cygwin to just do the "isatty" check as originally. Here's a proposed patch. Thoughts? -- Álvaro Herrera http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services --EeQfGwPcQSOJBaQU Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="Revert-Blind-attempt-at-a-Cygwin-fix.patch" From af7989c37cb8a1d647e6ce7d01857491b42b01b5 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Fri, 8 Jan 2016 12:36:18 -0300 Subject: [PATCH] Revert "Blind attempt at a Cygwin fix" This reverts commit e9282e953205a2f3125fc8d1052bc01cb77cd2a3, which blew up in a pretty spectacular way. Introduce the original code while we search for a real fix. --- configure | 6 ------ configure.in | 1 - src/bin/pg_ctl/pg_ctl.c | 9 +++++++++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/configure b/configure index ab213a1..3dd1b15 100755 --- a/configure +++ b/configure @@ -13075,12 +13075,6 @@ if test "$PORTNAME" = "cygwin"; then ;; esac - case " $LIBOBJS " in - *" win32security.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS win32security.$ac_objext" - ;; -esac - fi ac_fn_c_check_decl "$LINENO" "sys_siglist" "ac_cv_have_decl_sys_siglist" "#include diff --git a/configure.in b/configure.in index 41402df..9398482 100644 --- a/configure.in +++ b/configure.in @@ -1596,7 +1596,6 @@ fi # Cygwin needs only a bit of that if test "$PORTNAME" = "cygwin"; then AC_LIBOBJ(dirmod) - AC_LIBOBJ(win32security) fi AC_CHECK_DECLS([sys_siglist], [], [], diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c index 28d3cf2..919d764 100644 --- a/src/bin/pg_ctl/pg_ctl.c +++ b/src/bin/pg_ctl/pg_ctl.c @@ -212,6 +212,15 @@ write_stderr(const char *fmt,...) vfprintf(stderr, fmt, ap); #else +/* + * On Cygwin, we don't yet have a reliable mechanism to detect when + * we're being run as a service, so fall back to the old (and broken) + * stderr test. + */ +#ifdef __CYGWIN__ +#define pgwin32_is_service() (isatty(fileno(stderr))) +#endif + /* * On Win32, we print to stderr if running on a console, or write to * eventlog if running as a service -- 2.1.4 --EeQfGwPcQSOJBaQU Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers --EeQfGwPcQSOJBaQU--