The attached patch was added to patch 956272 which has the desired effect.




#if defined(STRUCT_STATVFS_HAS_F_FRSIZE) && !defined(linux) Andy Smith wrote:
Try
   #if defined(STRUCT_STATVFS_HAS_F_FRSIZE) && !defined(linux)

That worked for me.

Andy

Bruce Shaw wrote:

ARGG!!

Stupid newbie question.

How do I do a logical AND inside an ifdef?  Something like..

#ifdef solaris2 AND STRUCT_STATVFS_HAS_F_FRSIZE

?

which reminds me...

where is the value of STRUCT_STATVFS_HAS_F_FRSIZE set anyway? It's undef'd
in acconfig.h but i can't find where it gets assigned its value.




It looks like one of the recent patches broke the host resource mib on

Linux. I have tried compiling on a Mandrake 9.1 system and recieved the following:



host/hr_filesys.c: In function `Get_FSSize':
host/hr_filesys.c:798: structure has no member named `f_frsize'


I'm wondering if I should be using #if instead of #ifdef.

19-Jun-2004 Mike Slifcak
Modified from original patch "hr_filesys.FRSIZE.diff"
 to be Solaris2 specific.
since Linux compiles failed

There may be other combinations that are more universal,
and those are left for another time.



--- net-snmp-5.1.2.pre2/agent/mibgroup/host/hr_filesys.c        2004-06-15 
05:29:04.000000000 -0600
+++ agent/mibgroup/host/hr_filesys.c    2004-06-16 15:01:35.725565000 -0600
@@ -804,10 +804,14 @@
                 * in case of 512 (f_blocks/2) is returned
                 * otherwise (f_blocks*(f_bsize/1024)) is returned
                 */
-               if (statfs_buf.f_bsize == 512)
-                   return (statfs_buf.f_blocks/2);
+#if defined(solaris2) && defined(STRUCT_STATVFS_HAS_F_FRSIZE)
+                return (statfs_buf.f_blocks*(statfs_buf.f_frsize/1024));
+#else
+                if (statfs_buf.f_bsize == 512)
+                    return (statfs_buf.f_blocks/2);
                 else
-                   return (statfs_buf.f_blocks*(statfs_buf.f_bsize/1024));
+                    return (statfs_buf.f_blocks*(statfs_buf.f_bsize/1024));
+#endif
             else
                 return -1;
         }

Reply via email to