From e99ffb4b0b09d883666e621eba0bb41ac4233d9f Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Tue, 13 Dec 2011 20:37:47 +0100 Subject: Properly detect /dev/null as raw device and do not set DIRECT flag on raw devices --- fastwriter.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'fastwriter.c') 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) { -- cgit v1.2.3