summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/Fcntl/Fcntl.pm18
-rw-r--r--ext/Socket/Socket.pm10
-rw-r--r--ext/Sys/Syslog/Syslog.pm12
3 files changed, 18 insertions, 22 deletions
diff --git a/ext/Fcntl/Fcntl.pm b/ext/Fcntl/Fcntl.pm
index c68dda1c2f..6e4236713d 100644
--- a/ext/Fcntl/Fcntl.pm
+++ b/ext/Fcntl/Fcntl.pm
@@ -60,7 +60,7 @@ our($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS, $AUTOLOAD);
require Exporter;
use XSLoader ();
@ISA = qw(Exporter);
-$VERSION = "1.03";
+$VERSION = "1.04";
# Items to export into callers namespace by default
# (move infrequently used names to @EXPORT_OK below)
@EXPORT =
@@ -201,17 +201,11 @@ sub S_ISENFMT { ( $_[0] & _S_IFMT() ) == S_IFENFMT() }
sub AUTOLOAD {
(my $constname = $AUTOLOAD) =~ s/.*:://;
- my $val = constant($constname);
- if ($! != 0) {
- if ($! =~ /Invalid/ || $!{EINVAL}) {
- $AutoLoader::AUTOLOAD = $AUTOLOAD;
- goto &AutoLoader::AUTOLOAD;
- }
- else {
- my ($pack,$file,$line) = caller;
- die "Your vendor has not defined Fcntl macro $constname, used at $file line $line.
-";
- }
+ die "&Fcntl::constant not defined" if $constname eq 'constant';
+ my ($error, $val) = constant($constname);
+ if ($error) {
+ my (undef,$file,$line) = caller;
+ die "$error at $file line $line.\n";
}
*$AUTOLOAD = sub { $val };
goto &$AUTOLOAD;
diff --git a/ext/Socket/Socket.pm b/ext/Socket/Socket.pm
index 344c87dc94..2b2c03eca6 100644
--- a/ext/Socket/Socket.pm
+++ b/ext/Socket/Socket.pm
@@ -1,7 +1,7 @@
package Socket;
our($VERSION, @ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS);
-$VERSION = "1.72";
+$VERSION = "1.73";
=head1 NAME
@@ -329,10 +329,10 @@ sub sockaddr_un {
sub AUTOLOAD {
my($constname);
($constname = $AUTOLOAD) =~ s/.*:://;
- my $val = constant($constname, @_ ? $_[0] : 0);
- if ($! != 0) {
- my ($pack,$file,$line) = caller;
- croak "Your vendor has not defined Socket macro $constname, used";
+ croak "&Socket::constant not defined" if $constname eq 'constant';
+ my ($error, $val) = constant($constname);
+ if ($error) {
+ croak $error;
}
eval "sub $AUTOLOAD () { $val }";
goto &$AUTOLOAD;
diff --git a/ext/Sys/Syslog/Syslog.pm b/ext/Sys/Syslog/Syslog.pm
index 9c05dcd1f5..eabf7b4dac 100644
--- a/ext/Sys/Syslog/Syslog.pm
+++ b/ext/Sys/Syslog/Syslog.pm
@@ -7,7 +7,7 @@ use Carp;
@ISA = qw(Exporter DynaLoader);
@EXPORT = qw(openlog closelog setlogmask syslog);
@EXPORT_OK = qw(setlogsock);
-$VERSION = '0.01';
+$VERSION = '0.02';
use Socket;
use Sys::Hostname;
@@ -119,6 +119,8 @@ E<lt>F<Tim.Bunce@ig.co.uk>E<gt> and the perl5-porters mailing list.
Dependency on F<syslog.ph> replaced with XS code by Tom Hughes
E<lt>F<tom@compton.nu>E<gt>.
+Code for constant()s regenerated by Nicholas Clark E<lt>nick@ccl4.orgE<gt>.
+
=cut
sub AUTOLOAD {
@@ -128,10 +130,10 @@ sub AUTOLOAD {
my $constname;
our $AUTOLOAD;
($constname = $AUTOLOAD) =~ s/.*:://;
- croak "& not defined" if $constname eq 'constant';
- my $val = constant($constname);
- if ($! != 0) {
- croak "Your vendor has not defined Sys::Syslog macro $constname";
+ croak "&Sys::Syslog::constant not defined" if $constname eq 'constant';
+ my ($error, $val) = constant($constname);
+ if ($error) {
+ croak $error;
}
*$AUTOLOAD = sub { $val };
goto &$AUTOLOAD;