Jan Safranek wrote:
> Desmond Vicks wrote:
>> Jan Safranek wrote:
>>> I had the disk space 
>>> usage on my TODO list for some time, now I finally have some patch to 
>>> share. You can see it at
>>> https://sourceforge.net/tracker/index.php?func=detail&aid=2449210&group_id=12694&atid=312694
>>>
>>> I'd appreciate comments and testing (preferably on some platforms I 
>>> don't have, like Solaris, HP-UX, *BSD, Windows, ...)
>> I just tried applying this patch against the Net-SNMP trunk from svn 
>> [1], revision 17325, but had no luck:
>>
>>
>> prime% patch < ../net-snmp-big-disk.patch 
>>  
>> Hmm...  Looks like a unified diff to me...
>> The text leading up to this was:
>> --------------------------
>> |Add 64-bit disk space statistics.
>> |
>> |diff --git a/net-snmp/agent/mibgroup/ucd-snmp/disk.c 
>> b/net-snmp/agent/mibgroup/ucd-snmp/disk.c
>> |index b0d6906..186bdd2 100644
>> |--- a/net-snmp/agent/mibgroup/ucd-snmp/disk.c
>> |+++ b/net-snmp/agent/mibgroup/ucd-snmp/disk.c
>> --------------------------
>> File to patch: agent/mibgroup/ucd-snmp/disk.c
>> Patching file agent/mibgroup/ucd-snmp/disk.c using Plan A...
>> Hunk #1 succeeded at 169.
>> Hunk #2 succeeded at 201.
>> Hunk #3 succeeded at 666.
>> patch: **** unexpected end of file in patch
>>
>>
>> Can you see what I'm doing wrong here?
> 
> Ouch, the patch didn't have newline at the end. I attached fixed one to 
> the SF.net tracker. And it would be better to use 'patch -p2 
> <../net-snmp-big-disk.patch', it shouldn't ask for the file(s) to patch 
> then.

I've tried this again and the patch applied successfully, thanks.  Now, 
however, I run into problems compiling the agent.  This is on FreeBSD 
7.0 amd64 and r17347 of net-snmp trunk:


prime% make
...
making all in /usr/home/dc/net-snmp/agent/mibgroup
/bin/sh ../../libtool --mode=compile gcc -I../../include -I. 
-I../../agent -I../../agent/mibgroup  -I../../snmplib   -g -O2 
-Ufreebsd7 -Dfreebsd7=freebsd7 
-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.8/BSDPAN" -DHAS_FPSETMASK 
-DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe 
-Wdeclaration-after-statement -I/usr/local/include 
-I/usr/local/lib/perl5/5.8.8/mach/CORE  -Wall -Winline 
-Wstrict-prototypes -Wwrite-strings -Wcast-qual -Wno-char-subscripts -c 
-o mibII/icmp.lo mibII/icmp.c
libtool: compile:  gcc -I../../include -I. -I../../agent 
-I../../agent/mibgroup -I../../snmplib -g -O2 -Ufreebsd7 
-Dfreebsd7=freebsd7 -DAPPLLIB_EXP=/usr/local/lib/perl5/5.8.8/BSDPAN 
-DHAS_FPSETMASK -DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe 
-Wdeclaration-after-statement -I/usr/local/include 
-I/usr/local/lib/perl5/5.8.8/mach/CORE -Wall -Winline 
-Wstrict-prototypes -Wwrite-strings -Wcast-qual -Wno-char-subscripts -c 
mibII/icmp.c  -fPIC -DPIC -o mibII/.libs/icmp.o
mibII/icmp.c: In function 'init_icmp':
mibII/icmp.c:167: warning: unused variable 'table_info'
mibII/icmp.c:166: warning: unused variable 'iinfo'
mibII/icmp.c: In function 'icmp_handler':
mibII/icmp.c:411: error: invalid use of undefined type 'struct icmpstat'
mibII/icmp.c:412: error: invalid use of undefined type 'struct icmpstat'
<many more of these>
mibII/icmp.c:494: error: invalid use of undefined type 'struct icmpstat'
mibII/icmp.c: In function 'icmp_load':
mibII/icmp.c:974: error: invalid application of 'sizeof' to incomplete 
type 'struct icmpstat'
mibII/icmp.c: In function 'icmp_free':
mibII/icmp.c:1001: error: invalid application of 'sizeof' to incomplete 
type 'struct icmpstat'
*** Error code 1

Stop in /usr/home/dc/net-snmp/agent/mibgroup.
*** Error code 1

Stop in /usr/home/dc/net-snmp/agent.
*** Error code 1

Stop in /usr/home/dc/net-snmp.


This doesn't look like a problem related to your patch though, but I'm 
only guessing.

I've also tried patching against net-snmp-5.4.2.1 and that failed to 
build also, but at a different point:

prime% make
...
/bin/sh ../../libtool --mode=compile gcc -I../../include -I. 
-I../../agent -I../../agent/mibgroup  -I../../snmplib   -g -O2 
-Ufreebsd7 -Dfreebsd7=freebsd7 
-DAPPLLIB_EXP="/usr/local/lib/perl5/5.8.8/BSDPAN" -DHAS_FPSETMASK 
-DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe 
-Wdeclaration-after-statement -I/usr/local/include 
-I/usr/local/lib/perl5/5.8.8/mach/CORE -c -o ucd-snmp/disk.lo 
ucd-snmp/disk.c
  gcc -I../../include -I. -I../../agent -I../../agent/mibgroup 
-I../../snmplib -g -O2 -Ufreebsd7 -Dfreebsd7=freebsd7 
-DAPPLLIB_EXP=/usr/local/lib/perl5/5.8.8/BSDPAN -DHAS_FPSETMASK 
-DHAS_FLOATINGPOINT_H -fno-strict-aliasing -pipe 
-Wdeclaration-after-statement -I/usr/local/include 
-I/usr/local/lib/perl5/5.8.8/mach/CORE -c ucd-snmp/disk.c  -fPIC -DPIC 
-o ucd-snmp/.libs/disk.o
ucd-snmp/disk.c: In function 'var_extensible_disk':
ucd-snmp/disk.c:697: error: 'entry' undeclared (first use in this function)
ucd-snmp/disk.c:697: error: (Each undeclared identifier is reported only 
once
ucd-snmp/disk.c:697: error: for each function it appears in.)
ucd-snmp/disk.c:709: warning: return makes pointer from integer without 
a cast
ucd-snmp/disk.c: At top level:
ucd-snmp/disk.c:850: error: redefinition of 'var_extensible_disk'
ucd-snmp/disk.c:662: error: previous definition of 'var_extensible_disk' 
was here
ucd-snmp/disk.c: In function 'var_extensible_disk':
ucd-snmp/disk.c:852: error: storage size of 'entry' isn't known
*** Error code 1

Stop in /usr/home/dc/net-snmp-5.4.2.1/agent/mibgroup.
*** Error code 1

Stop in /usr/home/dc/net-snmp-5.4.2.1/agent.
*** Error code 1

Stop in /usr/home/dc/net-snmp-5.4.2.1.


You mentioned successfully building a patched agent for OpenSolaris. 
Which version/revision of net-snmp did you use?  Should this patch work 
with the current trunk of net-snmp?

Many thanks for your effort so far.


-- 
Dez

------------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It is the best place to buy or sell services for
just about anything Open Source.
http://p.sf.net/sfu/Xq1LFB
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to