On Tue, Aug 9, 2011 at 4:07 PM,  <ali.br...@selexelsag.com> wrote:
> I downloaded and built with the latest 5.7.1 pre release.
>
> During the Perl tests it no longer crashed the snmpd.exe, however it still
> locks up at the same point:

The patch below fixes that lockup on my setup:

diff --git a/perl/SNMP/SNMP.pm b/perl/SNMP/SNMP.pm
index 50658a1..64e6e8b 100644
--- a/perl/SNMP/SNMP.pm
+++ b/perl/SNMP/SNMP.pm
@@ -60,16 +60,10 @@ sub AUTOLOAD {
     ($constname = $AUTOLOAD) =~ s/.*:://;
     # croak "&$module::constant not defined" if $constname eq 'constant';
     $val = constant($constname, @_ ? $_[0] : 0);
-    if ($! != 0) {
-       if ($! =~ /Invalid/) {
-           $AutoLoader::AUTOLOAD = $AUTOLOAD;
-           goto &AutoLoader::AUTOLOAD;
-       }
-       else {
-           ($pack,$file,$line) = caller;
-           die "Your vendor has not defined SNMP macro $constname, used at
$file line $line.
+    if ($val < -1) {
+       ($pack,$file,$line) = caller;
+        die "Your vendor has not defined SNMP macro $constname, used
at $file line $line.
 ";
-       }
     }
     eval "sub $AUTOLOAD { $val }";
     goto &$AUTOLOAD;
diff --git a/perl/SNMP/SNMP.xs b/perl/SNMP/SNMP.xs
index dfe5791..1676776 100644
--- a/perl/SNMP/SNMP.xs
+++ b/perl/SNMP/SNMP.xs
@@ -2409,7 +2409,6 @@ constant(name, arg)
 char *name;
 int arg;
 {
-    errno = 0;
     switch (*name) {
     case 'R':
        if (strEQ(name, "NETSNMP_CALLBACK_OP_RECEIVED_MESSAGE"))
@@ -2545,13 +2544,11 @@ int arg;
     default:
        break;
     }
-    errno = EINVAL;
-    return 0;
+    return -EINVAL;

 not_there:
     not_here(name);
-    errno = ENOENT;
-    return 0;
+    return -ENOENT;
 }

 /*

Attachment: fix-windows-perl-test-lockup.patch
Description: Binary data

------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. 
http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to