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 --- sysinfo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sysinfo.c') diff --git a/sysinfo.c b/sysinfo.c index 3805dcc..52354e7 100644 --- a/sysinfo.c +++ b/sysinfo.c @@ -48,7 +48,7 @@ static int compare_mem_table_structs(const void *a, const void *b){ return strcmp(((const mem_table_struct*)a)->name,((const mem_table_struct*)b)->name); } -size_t get_free_memory(void){ +size_t fastwriter_get_free_memory(void){ char buf[4096]; unsigned long kb_main_buffers, kb_main_cached, kb_main_free; char namebuf[16]; /* big enough to hold any row name */ @@ -92,7 +92,7 @@ nextline: } -int get_file_fs(const char *fname, size_t size, char *fs) { +int fastwriter_get_file_fs(const char *fname, size_t size, char *fs) { int err = 0; char buf[4096]; char *fn; @@ -115,7 +115,7 @@ int get_file_fs(const char *fname, size_t size, char *fs) { } if (!stat(fn, &st)) { - if (S_ISBLK(st.st_mode)) { + if (!S_ISREG(st.st_mode)) { strcpy(fs, "raw"); goto clean; } -- cgit v1.2.3