summaryrefslogtreecommitdiffstats
path: root/fastwriter.c
diff options
context:
space:
mode:
authorSuren A. Chilingaryan <csa@dside.dyndns.org>2011-12-13 20:37:47 +0100
committerSuren A. Chilingaryan <csa@dside.dyndns.org>2011-12-13 20:37:47 +0100
commite99ffb4b0b09d883666e621eba0bb41ac4233d9f (patch)
tree7691b2b877ae7df29eaabe30b75f35bc86b63295 /fastwriter.c
parent9c14774f2b6b22628a8b57b7a1e5edec1e236f9c (diff)
downloadfastwriter-e99ffb4b0b09d883666e621eba0bb41ac4233d9f.tar.gz
fastwriter-e99ffb4b0b09d883666e621eba0bb41ac4233d9f.tar.bz2
fastwriter-e99ffb4b0b09d883666e621eba0bb41ac4233d9f.tar.xz
fastwriter-e99ffb4b0b09d883666e621eba0bb41ac4233d9f.zip
Properly detect /dev/null as raw device and do not set DIRECT flag on raw devices
Diffstat (limited to 'fastwriter.c')
-rw-r--r--fastwriter.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/fastwriter.c b/fastwriter.c
index 529acd6..84ef022 100644
--- a/fastwriter.c
+++ b/fastwriter.c
@@ -57,7 +57,7 @@ int fastwriter_open(fastwriter_t *ctx, const char *name, fastwriter_flags_t flag
ctx->size = FASTWRITER_DEFAULT_BUFFER_SIZE;
break;
case FASTWRITER_BUFFER_MAX:
- ctx->size = get_free_memory();
+ ctx->size = fastwriter_get_free_memory();
if ((ctx->size - FASTWRITER_RESERVE_MEMORY) < FASTWRITER_DEFAULT_BUFFER_SIZE)
ctx->size = FASTWRITER_DEFAULT_BUFFER_SIZE;
@@ -266,7 +266,6 @@ int fastwriter_push(fastwriter_t *ctx, size_t size, const void *data) {
if (ctx->pos < ctx->tail) end = ctx->tail;
else end = ctx->size;
-
part1 = end - ctx->pos;
if (part1 < size) {