aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2007-04-01 07:51:30 +0000
committerDaniel Stenberg <daniel@haxx.se>2007-04-01 07:51:30 +0000
commit5e7164f87a7b65a4790b3b3e080664dabc8d50a4 (patch)
treefe1d1a6e07225fe0d99dd7364e8ed49f6aebb244 /src
parentef10eaeb29e3a8a2ad92e10f44679e1298fce1d5 (diff)
Matt Kraai provided a patch that makes curl build on QNX 6 fine again. Mostly
by letting configure check for setmode and ifdef on HAVE_SETMODE. NOTE: non- configure platforms that havve setmode() needs their hard-coded config.h files fixed. I fixed the src/config-win32.h.
Diffstat (limited to 'src')
-rw-r--r--src/config-win32.h3
-rw-r--r--src/main.c6
2 files changed, 6 insertions, 3 deletions
diff --git a/src/config-win32.h b/src/config-win32.h
index 047f28e85..6e0380a3b 100644
--- a/src/config-win32.h
+++ b/src/config-win32.h
@@ -72,6 +72,9 @@
/* FUNCTIONS */
/* ---------------------------------------------------------------- */
+/* Define if you have the setmode function. */
+#define HAVE_SETMODE 1
+
/* Define if you have the ftruncate function. */
#define HAVE_FTRUNCATE 1
diff --git a/src/main.c b/src/main.c
index 391288708..48a74bee4 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2014,7 +2014,7 @@ static ParameterError getparameter(char *flag, /* f or -long-flag */
if(curlx_strequal("-", nextarg)) {
file = stdin;
-#ifdef O_BINARY
+#if defined(O_BINARY) && defined(HAVE_SETMODE)
if(subletter == 'b') /* forced binary */
setmode(fileno(stdin), O_BINARY);
#endif
@@ -3966,7 +3966,7 @@ operate(struct Configurable *config, int argc, char *argv[])
}
else if(uploadfile && curlx_strequal(uploadfile, "-")) {
-#ifdef O_BINARY
+#if defined(O_BINARY) && defined(HAVE_SETMODE)
setmode(fileno(stdin), O_BINARY);
#endif
infd = stdin;
@@ -4029,7 +4029,7 @@ operate(struct Configurable *config, int argc, char *argv[])
if(!config->errors)
config->errors = stderr;
-#ifdef O_BINARY
+#if defined(O_BINARY) && defined(HAVE_SETMODE)
if(!outfile && !(config->conf & CONF_GETTEXT)) {
/* We get the output to stdout and we have not got the ASCII/text flag,
then set stdout to be binary */