Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5Crb-0000yL-6n for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Sep 2018 16:40:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1g5CrX-0000nj-JU for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Sep 2018 16:40:31 +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.89) (envelope-from ) id 1g5CrX-0000nc-CZ for pgsql-hackers@lists.postgresql.org; Wed, 26 Sep 2018 16:40:31 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1g5CrU-00076u-J5 for pgsql-hackers@lists.postgresql.org; Wed, 26 Sep 2018 16:40:30 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id w8QGeMRo004962; Wed, 26 Sep 2018 12:40:22 -0400 From: Tom Lane To: Michael Paquier cc: Alvaro Herrera , Thomas Munro , PostgreSQL Hackers Subject: Re: Allowing printf("%m") only where it actually works In-reply-to: <3034.1537974599@sss.pgh.pa.us> References: <20180925154829.rbjxmmcpd5z7ueyq@alvherre.pgsql> <28378.1537891542@sss.pgh.pa.us> <20180925224223.GB1659@paquier.xyz> <3034.1537974599@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Wed, 26 Sep 2018 11:09:59 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <4960.1537980022.1@sss.pgh.pa.us> Date: Wed, 26 Sep 2018 12:40:22 -0400 Message-ID: <4961.1537980022@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > While looking over the thread, I remembered I wanted to convert > strerror_r into a wrapper as well. Think I'll go do that next, > because really it'd be better for snprintf.c to be calling strerror_r > not strerror. So while chasing that, I realized that libpq contains its own version of the backend's win32_socket_strerror code, in libpq/win32.c. This probably explains why we've not heard complaints about bogus socket error reports from libpq; it's that code that's handling it. What I think ought to happen is to merge win32.c's version of that code into strerror.c, which'd allow removing win32.c and win32.h altogether. However, not having a Windows environment, I can't test such changes and probably shouldn't be the one to take point on making the change. Anybody? regards, tom lane