aboutsummaryrefslogtreecommitdiffstats
path: root/util/iobuf.c
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2000-07-28 16:19:07 +0000
committerWerner Koch <[email protected]>2000-07-28 16:19:07 +0000
commitd81c3f733ba813dae4fc6bed6073551449dcc65c (patch)
treedc0bc70f697b7b4623d359b172cae2b035347aa3 /util/iobuf.c
parentSee ChangeLog: Tue Jul 25 17:44:15 CEST 2000 Werner Koch (diff)
downloadgnupg-d81c3f733ba813dae4fc6bed6073551449dcc65c.tar.gz
gnupg-d81c3f733ba813dae4fc6bed6073551449dcc65c.zip
See ChangeLog: Fri Jul 28 18:19:11 CEST 2000 Werner Koch
Diffstat (limited to 'util/iobuf.c')
-rw-r--r--util/iobuf.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/util/iobuf.c b/util/iobuf.c
index ce63b55b8..f7035ae4c 100644
--- a/util/iobuf.c
+++ b/util/iobuf.c
@@ -28,6 +28,9 @@
#include <sys/stat.h>
#include <unistd.h>
#include <gcrypt.h>
+#ifdef HAVE_DOSISH_SYSTEM
+ #include <fcntl.h> /* for setmode() */
+#endif
#include "memory.h"
#include "util.h"
@@ -580,7 +583,10 @@ iobuf_open( const char *fname )
int print_only = 0;
if( !fname || (*fname=='-' && !fname[1]) ) {
- fp = stdin; /* fixme: set binary mode for msdoze */
+ fp = stdin;
+ #ifdef HAVE_DOSISH_SYSTEM
+ setmode ( fileno(fp) , O_BINARY );
+ #endif
fname = "[stdin]";
print_only = 1;
}
@@ -647,6 +653,9 @@ iobuf_create( const char *fname )
if( !fname || (*fname=='-' && !fname[1]) ) {
fp = stdout;
+ #ifdef HAVE_DOSISH_SYSTEM
+ setmode ( fileno(fp) , O_BINARY );
+ #endif
fname = "[stdout]";
print_only = 1;
}
@@ -742,7 +751,10 @@ iobuf_fopen( const char *fname, const char *mode )
int print_only = 0;
if( !fname || (*fname=='-' && !fname[1]) ) {
- fp = stdin; /* fixme: set binary mode for msdoze */
+ fp = stdin;
+ #ifdef HAVE_DOSISH_SYSTEM
+ setmode ( fileno(fp) , O_BINARY );
+ #endif
fname = "[stdin]";
print_only = 1;
}