delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin-developers/1999/04/27/22:12:22

Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-developers-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin-developers AT sourceware DOT cygnus DOT com
From: Chris Faylor <cgf AT cygnus DOT com>
Date: Tue, 27 Apr 1999 22:11:53 -0400
To: DJ Delorie <dj AT delorie DOT com>
Cc: fortinj AT ibm DOT net, cygwin-developers AT sourceware DOT cygnus DOT com
Subject: Re: cygwin1.dll startup and GDB
Message-ID: <19990427221153.A28137@cygnus.com>
References: <37265A6E DOT 813F8ED8 AT ibm DOT net> <199904280131 DOT VAA28701 AT envy DOT delorie DOT com> <37266BBC DOT F8F24A3A AT ibm DOT net> <199904280206 DOT WAA05486 AT envy DOT delorie DOT com>
Mime-Version: 1.0
X-Mailer: Mutt 0.95.3i
In-Reply-To: <199904280206.WAA05486@envy.delorie.com>; from DJ Delorie on Tue, Apr 27, 1999 at 10:06:24PM -0400

Maybe this will fix things.

There's no need to call OpenFileMapping with a NULL pointer so
don't do it.

cgf

Index: shared.cc
===================================================================
RCS file: /cvs/cvsfiles/devo/winsup/shared.cc,v
retrieving revision 1.55
diff -u -p -r1.55 shared.cc
--- shared.cc	1999/04/01 03:56:55	1.55
+++ shared.cc	1999/04/28 02:10:52
@@ -49,11 +49,15 @@ open_shared (const char *name, HANDLE &s
 
   if (!shared_h)
     {
-      char *mapname = name ? shared_name (name, 0) : NULL;
-
-      shared_h = OpenFileMappingA (FILE_MAP_READ | FILE_MAP_WRITE,
-				   TRUE, mapname);
-
+      char *mapname;
+      if (!name)
+	mapname = NULL;
+      else
+	{
+	  mapname = shared_name (name, 0);
+	  shared_h = OpenFileMappingA (FILE_MAP_READ | FILE_MAP_WRITE,
+				       TRUE, mapname);
+	} 
       if (!shared_h &&
 	  !(shared_h = CreateFileMappingA ((HANDLE) 0xffffffff,
 					   &sec_all,

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019