Revert "Clarify fs free stats."
authorBrenden Matthews <brenden@rty.ca>
Wed, 10 Jun 2009 20:09:34 +0000 (14:09 -0600)
committerBrenden Matthews <brenden@rty.ca>
Wed, 10 Jun 2009 20:09:34 +0000 (14:09 -0600)
This reverts commit da65a4bcf8e3746cf746b1e943441900169fdffe.

doc/variables.xml
src/conky.c

index 19b078b..b8336c5 100644 (file)
         </term>
         <listitem>Bar that shows how much space is free on a file
         system. height is the height in pixels. fs is any file on
-        that file system. This uses f_bfree (as per man 2 statfs)
-        if it's available, or f_bavail as a fallback. 
+        that file system. 
         <para /></listitem>
     </varlistentry>
     <varlistentry>
             </command>
             <option>(fs)</option>
         </term>
-        <listitem>Free space on a file system. This uses f_bfree
-        (as per man 2 statfs) if it's available, or f_bavail as a
-        fallback. 
+        <listitem>Free space on a file system available for users. 
         <para /></listitem>
     </varlistentry>
     <varlistentry>
             </command>
             <option>(fs)</option>
         </term>
-        <listitem>Free percentage of space on a file system. This
-        uses f_bfree (as per man 2 statfs) if it's available, or
-        f_bavail as a fallback. 
+        <listitem>Free percentage of space on a file system
+        available for users. 
         <para /></listitem>
     </varlistentry>
     <varlistentry>
             </command>
             <option>(fs)</option>
         </term>
-        <listitem>File system used space. This uses f_bfree (as per
-        man 2 statfs) if it's available, or f_bavail as a fallback.
+        <listitem>File system used space. 
         <para /></listitem>
     </varlistentry>
     <varlistentry>
             </command>
             <option>(fs)</option>
         </term>
-        <listitem>Percent of file system used space. This uses
-        f_bfree (as per man 2 statfs) if it's available, or
-        f_bavail as a fallback. 
+        <listitem>Percent of file system used space. 
         <para /></listitem>
     </varlistentry>
     <varlistentry>
index bad64f7..90fa2d3 100644 (file)
@@ -4327,19 +4327,13 @@ static void generate_text_internal(char *p, int p_max_size,
 #ifdef X11
                                                if(output_methods & TO_X) {
                                                        new_bar(p, obj->data.fsbar.w, obj->data.fsbar.h,
-                                                                       (int) (255 - (obj->data.fs->free ?
-                                                                                       obj->data.fs->free :
-                                                                                       obj->data.fsbar.fs->avail) * 255 /
-                                                                               obj->data.fs->size));
+                                                               (int) (255 - obj->data.fsbar.fs->avail * 255 /
+                                                               obj->data.fs->size));
                                                }else{
 #endif /* X11 */
                                                        if(!obj->data.fsbar.w) obj->data.fsbar.w = DEFAULT_BAR_WIDTH_NO_X;
-                                                       new_bar_in_shell(p, p_max_size, (int) (100 -
-                                                                               (obj->data.fs->free ?
-                                                                                obj->data.fs->free :
-                                                                                obj->data.fsbar.fs->avail) * 100 /
-                                                                               obj->data.fs->size),
-                                                                       obj->data.fsbar.w);
+                                                       new_bar_in_shell(p, p_max_size,
+                                                               (int) (100 - obj->data.fsbar.fs->avail * 100 / obj->data.fs->size), obj->data.fsbar.w);
 #ifdef X11
                                                }
 #endif /* X11 */
@@ -4397,17 +4391,13 @@ static void generate_text_internal(char *p, int p_max_size,
 #ifdef X11
                                                if(output_methods & TO_X) {
                                                        new_bar(p, obj->data.fsbar.w, obj->data.fsbar.h,
-                                                                       (int) ((obj->data.fs->free ?
-                                                                                       obj->data.fs->free :
-                                                                                       obj->data.fsbar.fs->avail) * 255 /
-                                                                               obj->data.fs->size));
+                                                               (int) (obj->data.fsbar.fs->avail * 255 /
+                                                               obj->data.fs->size));
                                                }else{
 #endif /* X11 */
                                                        if(!obj->data.fsbar.w) obj->data.fsbar.w = DEFAULT_BAR_WIDTH_NO_X;
-                                                       new_bar_in_shell(p, p_max_size, (int)
-                                                                       ((obj->data.fs->free ? obj->data.fs->free :
-                                                                         obj->data.fsbar.fs->avail) * 100 /
-                                                                        obj->data.fs->size), obj->data.fsbar.w);
+                                                       new_bar_in_shell(p, p_max_size,
+                                                               (int) (obj->data.fsbar.fs->avail * 100 / obj->data.fs->size), obj->data.fsbar.w);
 #ifdef X11
                                                }
 #endif /* X11 */