Mail Archives: cygwin/2002/02/17/03:14:54
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/
- Raw text -