aboutsummaryrefslogtreecommitdiffstats
path: root/g10/tdbio.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>1998-10-06 12:10:02 +0000
committerWerner Koch <[email protected]>1998-10-06 12:10:02 +0000
commitf04db5631158b3856ea11f300d02a03c7e15ede4 (patch)
tree6cd9c2416b65118f4da0aeceb6be2a7f1763e258 /g10/tdbio.c
parent*** empty log message *** (diff)
downloadgnupg-f04db5631158b3856ea11f300d02a03c7e15ede4.tar.gz
gnupg-f04db5631158b3856ea11f300d02a03c7e15ede4.zip
windoze version works again
Diffstat (limited to 'g10/tdbio.c')
-rw-r--r--g10/tdbio.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/g10/tdbio.c b/g10/tdbio.c
index 02950b502..ef29742fd 100644
--- a/g10/tdbio.c
+++ b/g10/tdbio.c
@@ -86,13 +86,17 @@ tdbio_set_dbname( const char *new_dbname, int create )
}
*p = '/';
- fp =fopen( fname, "w" );
+ fp =fopen( fname, "wb" );
if( !fp )
log_fatal_f( fname, _("can't create: %s\n"), strerror(errno) );
fclose(fp);
m_free(db_name);
db_name = fname;
+ #ifdef __MINGW32__
+ db_fd = open( db_name, O_RDWR | O_BINARY );
+ #else
db_fd = open( db_name, O_RDWR );
+ #endif
if( db_fd == -1 )
log_fatal_f( db_name, _("can't open: %s\n"), strerror(errno) );
@@ -131,7 +135,11 @@ open_db()
TRUSTREC rec;
assert( db_fd == -1 );
+ #ifdef __MINGW32__
+ db_fd = open( db_name, O_RDWR | O_BINARY );
+ #else
db_fd = open( db_name, O_RDWR );
+ #endif
if( db_fd == -1 )
log_fatal_f( db_name, _("can't open: %s\n"), strerror(errno) );
if( tdbio_read_record( 0, &rec, RECTYPE_VER ) )