/alps/fastwriter

To get this branch, use:
bzr branch http://darksoft.org/webbzr/alps/fastwriter

« back to all changes in this revision

Viewing changes to sysinfo.c

  • Committer: Suren A. Chilingaryan
  • Date: 2011-12-13 19:37:47 UTC
  • Revision ID: csa@dside.dyndns.org-20111213193747-g8ld48dh1kwypice
Properly detect /dev/null as raw device and do not set DIRECT flag on raw devices

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
  return strcmp(((const mem_table_struct*)a)->name,((const mem_table_struct*)b)->name);
49
49
}
50
50
 
51
 
size_t get_free_memory(void){
 
51
size_t fastwriter_get_free_memory(void){
52
52
  char buf[4096];
53
53
  unsigned long kb_main_buffers, kb_main_cached, kb_main_free;
54
54
  char namebuf[16]; /* big enough to hold any row name */
92
92
}
93
93
 
94
94
 
95
 
int get_file_fs(const char *fname, size_t size, char *fs) {
 
95
int fastwriter_get_file_fs(const char *fname, size_t size, char *fs) {
96
96
  int err = 0;
97
97
  char buf[4096];
98
98
  char *fn;
115
115
  }
116
116
  
117
117
  if (!stat(fn, &st)) {
118
 
    if (S_ISBLK(st.st_mode)) {
 
118
    if (!S_ISREG(st.st_mode)) {
119
119
        strcpy(fs, "raw");
120
120
        goto clean;
121
121
    }