From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9146 invoked by alias); 17 Feb 2002 08:14:30 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Received: (qmail 9005 invoked from network); 17 Feb 2002 08:14:25 -0000 Received: from unknown (HELO rwcrmhc54.attbi.com) (216.148.227.87) by sources.redhat.com with SMTP; 17 Feb 2002 08:14:25 -0000 Received: from ece.gatech.edu ([24.98.131.105]) by rwcrmhc54.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020217081424.WTON1214.rwcrmhc54.attbi.com@ece.gatech.edu>; Sun, 17 Feb 2002 08:14:24 +0000 Message-ID: <3C6F666D.40704@ece.gatech.edu> Date: Sun, 17 Feb 2002 00:14:00 -0000 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@cygwin.com Subject: Re: Possible patch for gdbm References: <20020213233512.97499.qmail@web21204.mail.yahoo.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2002-02/txt/msg00821.txt.bz2 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/