about summary refs log tree commit
diff options
context:
space:
mode:
authorGraham Barr <gbarr@pobox.com>1999-02-06 01:36:28 +0000
committerGraham Barr <gbarr@pobox.com>1999-02-06 01:36:28 +0000
commitb6abda47ba101483f57ea2313b505811bc3f3799 (patch)
tree59d0b72443baa3c09d0565bf369e62e6ce174622
parentc381beadf33bd717be1ab8e28246fd1bee44066f (diff)
downloadperl-libnet-b6abda47ba101483f57ea2313b505811bc3f3799.tar.gz
Net::Domain
- check for defined(&main::SYS_gethostname) before calling syscall
  as user may have a UNIVERSAL::AUTOLOADER defined

-rw-r--r--Net/Domain.pm4
1 files changed, 3 insertions, 1 deletions
diff --git a/Net/Domain.pm b/Net/Domain.pm
index 328efdb..765bfaa 100644
--- a/Net/Domain.pm
+++ b/Net/Domain.pm
@@ -16,7 +16,7 @@ use Net::Config;
 @ISA = qw(Exporter);
 @EXPORT_OK = qw(hostname hostdomain hostfqdn domainname);
 
-$VERSION = "2.10"; # $Id: //depot/libnet/Net/Domain.pm#8 $
+$VERSION = "2.11"; # $Id: //depot/libnet/Net/Domain.pm#9 $
 
 my($host,$domain,$fqdn) = (undef,undef,undef);
 
@@ -55,10 +55,12 @@ sub _hostname {
                 eval {
                     package main;
                      require "syscall.ph";
+                defined(&main::SYS_gethostname);
                 }
                 || eval {
                     package main;
                      require "sys/syscall.ph";
+                defined(&main::SYS_gethostname);
                 }
             and $host = (syscall(&main::SYS_gethostname, $tmp, 256) == 0)
                     ? $tmp