summaryrefslogtreecommitdiffstats
path: root/sysinfo.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 /sysinfo.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 'sysinfo.c')
-rw-r--r--sysinfo.c6
1 files changed, 3 insertions, 3 deletions
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;
}