aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2009-12-10 16:46:21 +0000
committerYang Tse <yangsita@gmail.com>2009-12-10 16:46:21 +0000
commit5ce6454d33d006f5d3cf9f7229bd7d89a07e9163 (patch)
tree50f99ad7069fd81b17a6b151fd3b6c2dd8709fad
parent0653fa107f6fb03555d49da86a1fbfc659873f5b (diff)
- Fixed curl erroneously reporting output stream write failures with disabled buffering
-rw-r--r--src/main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index b5c1d89b7..261bb880a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -3289,6 +3289,7 @@ static void go_sleep(long ms)
static size_t my_fwrite(void *buffer, size_t sz, size_t nmemb, void *stream)
{
+ int res;
size_t rc;
struct OutStruct *out=(struct OutStruct *)stream;
struct Configurable *config = out->config;
@@ -3323,8 +3324,8 @@ static size_t my_fwrite(void *buffer, size_t sz, size_t nmemb, void *stream)
if(config->nobuffer) {
/* disable output buffering */
- rc = fflush(out->stream);
- if(rc) {
+ res = fflush(out->stream);
+ if(res) {
/* return a value that isn't the same as sz * nmemb */
rc = (0 == (sz * nmemb)) ? 1 : 0;
return rc; /* failure */