Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bmOTJ-0004zy-BZ for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Sep 2016 17:04:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bmOTI-0005Co-QI for pgsql-hackers@arkaria.postgresql.org; Tue, 20 Sep 2016 17:04:40 +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_2) (envelope-from ) id 1bmORv-0003ft-Kt for pgsql-hackers@postgresql.org; Tue, 20 Sep 2016 17:03:15 +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.84_2) (envelope-from ) id 1bmORr-0003Nl-Tr for pgsql-hackers@postgresql.org; Tue, 20 Sep 2016 17:03:15 +0000 Received: from pro.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id u8KH37Pk012227; Tue, 20 Sep 2016 13:03:07 -0400 From: Tom Lane To: Robert Haas cc: Michael Paquier , Amit Kapila , Haribabu Kommi , Dmitry Vasilyev , pgsql-hackers Subject: Re: =?UTF-8?Q?Re=3A_=5BHACKERS=5D_Re=3A_=5BHACKERS=5D_Re=3A_=5BHACKERS=5D_Re=3A_=5BHACKE?= =?UTF-8?Q?RS=5D_Windows_service_is_not_starting_so_there=E2=80=99s_message_in_?= =?UTF-8?Q?log=3A_FATAL=3A_=22could_not_create_shared_memory_segment_=E2=80=9CGloba?= =?UTF-8?Q?l=2FPostgreSQL=2E851401618=E2=80=9D=3A_Permission_denied=E2=80=9D?= In-reply-to: References: <1444920387.3661.7.camel@postgrespro.ru> <1444921511.3661.13.camel@postgrespro.ru> <31461.1445090619@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Tue, 20 Sep 2016 12:14:35 -0400" Date: Tue, 20 Sep 2016 13:03:07 -0400 Message-ID: <20811.1474390987@sss.pgh.pa.us> X-Pg-Spam-Score: -5.0 (-----) 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 Robert Haas writes: > On Thu, May 26, 2016 at 7:44 PM, Michael Paquier > wrote: >> Yeah, it is definitely better to register it. And I have switched the >> patch as ready for committer just now. > Committed and back-patched to 9.4, where DSM was introduced. ISTM both the previous coding and this version can fail for no good reason, that is what if GetLastError() happens to return one of these error codes as a result of some unrelated failure from before this subroutine is entered? That is, wouldn't it be a good idea to do SetLastError(0) before calling CreateFileMapping? Or is the latter guaranteed to do that on success? I don't see that stated in its man page. regards, tom lane -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers