Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <3C6F666D.40704@ece.gatech.edu> Date: Sun, 17 Feb 2002 03:14:37 -0500 From: Charles Wilson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011019 Netscape6/6.2 X-Accept-Language: en-us MIME-Version: 1.0 To: AJ Reins CC: cygwin AT cygwin DOT com Subject: Re: Possible patch for gdbm References: <20020213233512 DOT 97499 DOT qmail AT web21204 DOT mail DOT yahoo DOT com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Thanks AJ. gdbm is next on my list for cygwin, but I'm kinda swamped right now. I'll try to get to releasing an updated version soon. --Chuck AJ Reins wrote: > diff -urN gdbm-1.8.0.old/gdbmopen.c > gdbm-1.8.0/gdbmopen.c > --- gdbm-1.8.0.old/gdbmopen.c Sat Jul 29 22:46:42 2000 > +++ gdbm-1.8.0/gdbmopen.c Thu Feb 7 09:25:48 2002 > @@ -126,21 +126,21 @@ > switch (flags & GDBM_OPENMASK) > { > case GDBM_READER: > - dbf->desc = open (dbf->name, O_RDONLY, 00444 ); /* > umask will restrict this */ > + dbf->desc = open (dbf->name, O_RDONLY|O_BINARY, > 00444 ); /* umask will restrict this */ > break; > > case GDBM_OPENMASK: > - dbf->desc = open (dbf->name, O_RDWR, 00666 ); /* > umask will restrict this */ > + dbf->desc = open (dbf->name, O_RDWR|O_BINARY, 00666 > ); /* umask will restrict this */ > break; > > case GDBM_NEWDB: > - dbf->desc = open (dbf->name, O_RDWR|O_CREAT, mode); > + dbf->desc = open (dbf->name, > O_RDWR|O_CREAT|O_BINARY, mode); > flags = GDBM_WRITER; > need_trunc = TRUE; > break; > > default: > - dbf->desc = open (dbf->name, O_RDWR|O_CREAT, mode); > + dbf->desc = open (dbf->name, > O_RDWR|O_CREAT|O_BINARY, mode); > flags = GDBM_WRITER; > break; > > diff -urN gdbm-1.8.0.old/systems.h > gdbm-1.8.0/systems.h > --- gdbm-1.8.0.old/systems.h Sat Jul 29 22:46:42 2000 > +++ gdbm-1.8.0/systems.h Thu Feb 7 09:31:50 2002 > @@ -136,11 +136,16 @@ > #define STATBLKSIZE 1024 > #endif > > +/* Paranoia never hurt, too much that is */ > +#ifndef O_BINARY > +#define O_BINARY 0 > +#endif > + > /* Do we have ftruncate? */ > #if HAVE_FTRUNCATE > #define TRUNCATE(dbf) ftruncate (dbf->desc, 0) > #else > -#define TRUNCATE(dbf) close( open (dbf->name, > O_RDWR|O_TRUNC, mode)); > +#define TRUNCATE(dbf) close( open (dbf->name, > O_RDWR|O_TRUNC|O_BINARY, mode)); > #endif > > #ifndef STDERR_FILENO > > > __________________________________________________ > Do You Yahoo!? > Send FREE Valentine eCards with Yahoo! Greetings! > http://greetings.yahoo.com > > -- > Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple > Bug reporting: http://cygwin.com/bugs.html > Documentation: http://cygwin.com/docs.html > FAQ: http://cygwin.com/faq/ > > -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/