diff options
Diffstat (limited to 'ext')
-rw-r--r-- | ext/DB_File/DB_File.pm | 4 | ||||
-rw-r--r-- | ext/DynaLoader/dl_vms.xs | 28 | ||||
-rw-r--r-- | ext/Fcntl/Fcntl.pm | 4 | ||||
-rw-r--r-- | ext/GDBM_File/GDBM_File.pm | 4 | ||||
-rw-r--r-- | ext/GDBM_File/GDBM_File.xs | 2 | ||||
-rw-r--r-- | ext/NDBM_File/NDBM_File.xs | 2 | ||||
-rw-r--r-- | ext/ODBM_File/ODBM_File.xs | 2 | ||||
-rw-r--r-- | ext/POSIX/POSIX.pm | 120 | ||||
-rw-r--r-- | ext/POSIX/POSIX.xs | 19 | ||||
-rw-r--r-- | ext/SDBM_File/SDBM_File.xs | 2 | ||||
-rw-r--r-- | ext/Socket/Socket.pm | 14 |
11 files changed, 100 insertions, 101 deletions
diff --git a/ext/DB_File/DB_File.pm b/ext/DB_File/DB_File.pm index 4cff8da4a9..1a75f155b4 100644 --- a/ext/DB_File/DB_File.pm +++ b/ext/DB_File/DB_File.pm @@ -213,10 +213,6 @@ require DynaLoader; ); sub AUTOLOAD { - if (@_ > 1) { - $AutoLoader::AUTOLOAD = $AUTOLOAD; - goto &AutoLoader::AUTOLOAD; - } local($constname); ($constname = $AUTOLOAD) =~ s/.*:://; $val = constant($constname, @_ ? $_[0] : 0); diff --git a/ext/DynaLoader/dl_vms.xs b/ext/DynaLoader/dl_vms.xs index 8486ae260c..c6e58fb33c 100644 --- a/ext/DynaLoader/dl_vms.xs +++ b/ext/DynaLoader/dl_vms.xs @@ -2,7 +2,7 @@ * * Platform: OpenVMS, VAX or AXP * Author: Charles Bailey bailey@genetics.upenn.edu - * Revised: 4-Sep-1994 + * Revised: 12-Dec-1994 * * Implementation Note * This section is added as an aid to users and DynaLoader developers, in @@ -60,6 +60,7 @@ #include <lib$routines.h> #include <rms.h> #include <ssdef.h> +#include <starlet.h> typedef unsigned long int vmssts; @@ -82,7 +83,7 @@ copy_errmsg(msg,unused) struct dsc$descriptor_s * msg; vmssts unused; { - if (*(msg->dsc$a_pointer) = '%') { /* first line */ + if (*(msg->dsc$a_pointer) == '%') { /* first line */ if (LastError) strncpy((LastError = saferealloc(LastError,msg->dsc$w_length)), msg->dsc$a_pointer, msg->dsc$w_length); @@ -105,12 +106,11 @@ dl_set_error(sts,stv) vmssts sts; vmssts stv; { - vmssts vec[3],pmsts; + vmssts vec[3]; vec[0] = stv ? 2 : 1; vec[1] = sts; vec[2] = stv; - if (!(pmsts = sys$putmsg(vec,copy_errmsg,0,0)) & 1) - croak("Fatal $PUTMSG error: %d",pmsts); + _ckvmssts(sys$putmsg(vec,copy_errmsg,0,0)); } static void @@ -131,7 +131,7 @@ MODULE = DynaLoader PACKAGE = DynaLoader BOOT: (void)dl_private_init(); -SV * +void dl_expandspec(filespec) char * filespec CODE: @@ -155,14 +155,14 @@ dl_expandspec(filespec) } else { /* Now set up a default spec - everything but the name */ - deflen = dlnam.nam$l_type - dlesa; + deflen = dlnam.nam$l_name - dlesa; memcpy(defspec,dlesa,deflen); memcpy(defspec+deflen,dlnam.nam$l_type, dlnam.nam$b_type + dlnam.nam$b_ver); deflen += dlnam.nam$b_type + dlnam.nam$b_ver; memcpy(vmsspec,dlnam.nam$l_name,dlnam.nam$b_name); DLDEBUG(2,fprintf(stderr,"\tsplit filespec: name = %.*s, default = %.*s\n", - dlnam.nam$b_name,vmsspec,defspec,deflen)); + dlnam.nam$b_name,vmsspec,deflen,defspec)); /* . . . and go back to expand it */ dlnam.nam$b_nop = 0; dlfab.fab$l_dna = defspec; @@ -190,7 +190,7 @@ dl_expandspec(filespec) } } -void * +void dl_load_file(filespec) char * filespec CODE: @@ -205,7 +205,7 @@ dl_load_file(filespec) unsigned short int len; unsigned short int code; char *string; - } namlst[2] = {0,FSCN$_NAME,0, 0,0,0}; + } namlst[2] = {{0,FSCN$_NAME,0},{0,0,0}}; struct libref *dlptr; vmssts sts, failed = 0; void *entry; @@ -215,7 +215,7 @@ dl_load_file(filespec) specdsc.dsc$w_length = strlen(specdsc.dsc$a_pointer); DLDEBUG(2,fprintf(stderr,"\tVMS-ified filespec is %s\n", specdsc.dsc$a_pointer)); - dlptr = safemalloc(sizeof(struct libref)); + New(7901,dlptr,1,struct libref); dlptr->name.dsc$b_dtype = dlptr->defspec.dsc$b_dtype = DSC$K_DTYPE_T; dlptr->name.dsc$b_class = dlptr->defspec.dsc$b_class = DSC$K_CLASS_S; sts = sys$filescan(&specdsc,namlst,0); @@ -266,11 +266,11 @@ dl_load_file(filespec) ST(0) = &sv_undef; } else { - ST(0) = sv_2mortal(newSViv(dlptr)); + ST(0) = sv_2mortal(newSViv((IV) dlptr)); } -void * +void dl_find_symbol(librefptr,symname) void * librefptr SV * symname @@ -293,7 +293,7 @@ dl_find_symbol(librefptr,symname) dl_set_error(sts,0); ST(0) = &sv_undef; } - else ST(0) = sv_2mortal(newSViv(entry)); + else ST(0) = sv_2mortal(newSViv((IV) entry)); void diff --git a/ext/Fcntl/Fcntl.pm b/ext/Fcntl/Fcntl.pm index b18d1365e5..d3f73c4cd7 100644 --- a/ext/Fcntl/Fcntl.pm +++ b/ext/Fcntl/Fcntl.pm @@ -20,10 +20,6 @@ require DynaLoader; ); sub AUTOLOAD { - if (@_ > 1) { - $AutoLoader::AUTOLOAD = $AUTOLOAD; - goto &AutoLoader::AUTOLOAD; - } local($constname); ($constname = $AUTOLOAD) =~ s/.*:://; $val = constant($constname, @_ ? $_[0] : 0); diff --git a/ext/GDBM_File/GDBM_File.pm b/ext/GDBM_File/GDBM_File.pm index cf260b51fa..646d7490ec 100644 --- a/ext/GDBM_File/GDBM_File.pm +++ b/ext/GDBM_File/GDBM_File.pm @@ -18,10 +18,6 @@ require DynaLoader; ); sub AUTOLOAD { - if (@_ > 1) { - $AutoLoader::AUTOLOAD = $AUTOLOAD; - goto &AutoLoader::AUTOLOAD; - } local($constname); ($constname = $AUTOLOAD) =~ s/.*:://; $val = constant($constname, @_ ? $_[0] : 0); diff --git a/ext/GDBM_File/GDBM_File.xs b/ext/GDBM_File/GDBM_File.xs index c6dc484fa1..8c7276dd2f 100644 --- a/ext/GDBM_File/GDBM_File.xs +++ b/ext/GDBM_File/GDBM_File.xs @@ -193,7 +193,7 @@ gdbm_STORE(db, key, value, flags = GDBM_REPLACE) if (RETVAL) { if (RETVAL < 0 && errno == EPERM) croak("No write permission to gdbm file"); - warn("gdbm store returned %d, errno %d, key \"%.*s\"", + croak("gdbm store returned %d, errno %d, key \"%.*s\"", RETVAL,errno,key.dsize,key.dptr); /* gdbm_clearerr(db); */ } diff --git a/ext/NDBM_File/NDBM_File.xs b/ext/NDBM_File/NDBM_File.xs index 52c08ebe76..d129a9c490 100644 --- a/ext/NDBM_File/NDBM_File.xs +++ b/ext/NDBM_File/NDBM_File.xs @@ -41,7 +41,7 @@ dbm_STORE(db, key, value, flags = DBM_REPLACE) if (RETVAL) { if (RETVAL < 0 && errno == EPERM) croak("No write permission to ndbm file"); - warn("ndbm store returned %d, errno %d, key \"%s\"", + croak("ndbm store returned %d, errno %d, key \"%s\"", RETVAL,errno,key.dptr); dbm_clearerr(db); } diff --git a/ext/ODBM_File/ODBM_File.xs b/ext/ODBM_File/ODBM_File.xs index 15737a0de8..2272474dcc 100644 --- a/ext/ODBM_File/ODBM_File.xs +++ b/ext/ODBM_File/ODBM_File.xs @@ -75,7 +75,7 @@ odbm_STORE(db, key, value, flags = DBM_REPLACE) if (RETVAL) { if (RETVAL < 0 && errno == EPERM) croak("No write permission to odbm file"); - warn("odbm store returned %d, errno %d, key \"%s\"", + croak("odbm store returned %d, errno %d, key \"%s\"", RETVAL,errno,key.dptr); } diff --git a/ext/POSIX/POSIX.pm b/ext/POSIX/POSIX.pm index 24e09fc3eb..b343200971 100644 --- a/ext/POSIX/POSIX.pm +++ b/ext/POSIX/POSIX.pm @@ -7,20 +7,22 @@ require DynaLoader; require Config; @ISA = qw(Exporter DynaLoader); -$H{assert_h} = [qw(assert NDEBUG)]; +%EXPORT_TAGS = ( -$H{ctype_h} = [qw(isalnum isalpha iscntrl isdigit isgraph islower - isprint ispunct isspace isupper isxdigit tolower toupper)]; + assert_h => [qw(assert NDEBUG)], -$H{dirent_h} = [qw()]; + ctype_h => [qw(isalnum isalpha iscntrl isdigit isgraph islower + isprint ispunct isspace isupper isxdigit tolower toupper)], -$H{errno_h} = [qw(E2BIG EACCES EAGAIN EBADF EBUSY ECHILD EDEADLK EDOM + dirent_h => [qw()], + + errno_h => [qw(E2BIG EACCES EAGAIN EBADF EBUSY ECHILD EDEADLK EDOM EEXIST EFAULT EFBIG EINTR EINVAL EIO EISDIR EMFILE EMLINK ENAMETOOLONG ENFILE ENODEV ENOENT ENOEXEC ENOLCK ENOMEM ENOSPC ENOSYS ENOTDIR ENOTEMPTY ENOTTY ENXIO - EPERM EPIPE ERANGE EROFS ESPIPE ESRCH EXDEV errno)]; + EPERM EPIPE ERANGE EROFS ESPIPE ESRCH EXDEV errno)], -$H{fcntl_h} = [qw(FD_CLOEXEC F_DUPFD F_GETFD F_GETFL F_GETLK F_RDLCK + fcntl_h => [qw(FD_CLOEXEC F_DUPFD F_GETFD F_GETFL F_GETLK F_RDLCK F_SETFD F_SETFL F_SETLK F_SETLKW F_UNLCK F_WRLCK O_ACCMODE O_APPEND O_CREAT O_EXCL O_NOCTTY O_NONBLOCK O_RDONLY O_RDWR O_TRUNC O_WRONLY @@ -28,9 +30,9 @@ $H{fcntl_h} = [qw(FD_CLOEXEC F_DUPFD F_GETFD F_GETFL F_GETLK F_RDLCK SEEK_CUR SEEK_END SEEK_SET S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISGID S_ISREG S_ISUID - S_IWGRP S_IWOTH S_IWUSR)]; + S_IWGRP S_IWOTH S_IWUSR)], -$H{float_h} = [qw(DBL_DIG DBL_EPSILON DBL_MANT_DIG + float_h => [qw(DBL_DIG DBL_EPSILON DBL_MANT_DIG DBL_MAX DBL_MAX_10_EXP DBL_MAX_EXP DBL_MIN DBL_MIN_10_EXP DBL_MIN_EXP FLT_DIG FLT_EPSILON FLT_MANT_DIG @@ -39,11 +41,11 @@ $H{float_h} = [qw(DBL_DIG DBL_EPSILON DBL_MANT_DIG FLT_RADIX FLT_ROUNDS LDBL_DIG LDBL_EPSILON LDBL_MANT_DIG LDBL_MAX LDBL_MAX_10_EXP LDBL_MAX_EXP - LDBL_MIN LDBL_MIN_10_EXP LDBL_MIN_EXP)]; + LDBL_MIN LDBL_MIN_10_EXP LDBL_MIN_EXP)], -$H{grp_h} = [qw()]; + grp_h => [qw()], -$H{limits_h} = [qw( ARG_MAX CHAR_BIT CHAR_MAX CHAR_MIN CHILD_MAX + limits_h => [qw( ARG_MAX CHAR_BIT CHAR_MAX CHAR_MIN CHILD_MAX INT_MAX INT_MIN LINK_MAX LONG_MAX LONG_MIN MAX_CANON MAX_INPUT MB_LEN_MAX NAME_MAX NGROUPS_MAX OPEN_MAX PATH_MAX PIPE_BUF SCHAR_MAX SCHAR_MIN SHRT_MAX SHRT_MIN @@ -52,30 +54,30 @@ $H{limits_h} = [qw( ARG_MAX CHAR_BIT CHAR_MAX CHAR_MIN CHILD_MAX _POSIX_LINK_MAX _POSIX_MAX_CANON _POSIX_MAX_INPUT _POSIX_NAME_MAX _POSIX_NGROUPS_MAX _POSIX_OPEN_MAX _POSIX_PATH_MAX _POSIX_PIPE_BUF _POSIX_SSIZE_MAX - _POSIX_STREADM_MAX _POSIX_TZNAME_MAX)]; + _POSIX_STREADM_MAX _POSIX_TZNAME_MAX)], -$H{locale_h} = [qw(LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY LC_NUMERIC - LC_TIME NULL localeconv setlocale)]; + locale_h => [qw(LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY LC_NUMERIC + LC_TIME NULL localeconv setlocale)], -$H{math_h} = [qw(HUGE_VAL acos asin atan ceil cosh fabs floor fmod - frexp ldexp log10 modf pow sinh tanh)]; + math_h => [qw(HUGE_VAL acos asin atan ceil cosh fabs floor fmod + frexp ldexp log10 modf pow sinh tanh)], -$H{pwd_h} = [qw()]; + pwd_h => [qw()], -$H{setjmp_h} = [qw(longjmp setjmp siglongjmp sigsetjmp)]; + setjmp_h => [qw(longjmp setjmp siglongjmp sigsetjmp)], -$H{signal_h} = [qw(SA_NOCLDSTOP SIGABRT SIGALRM SIGCHLD SIGCONT SIGFPE + signal_h => [qw(SA_NOCLDSTOP SIGABRT SIGALRM SIGCHLD SIGCONT SIGFPE SIGHUP SIGILL SIGINT SIGKILL SIGPIPE SIGQUIT SIGSEGV SIGSTOP SIGTERM SIGTSTP SIGTTIN SIGTTOU SIGUSR1 SIGUSR2 SIG_BLOCK SIG_DFL SIG_ERR SIG_IGN SIG_SETMASK SIG_UNBLOCK raise sigaction signal sigpending sigprocmask - sigsuspend)]; + sigsuspend)], -$H{stdarg_h} = [qw()]; + stdarg_h => [qw()], -$H{stddef_h} = [qw(NULL offsetof)]; + stddef_h => [qw(NULL offsetof)], -$H{stdio_h} = [qw(BUFSIZ EOF FILENAME_MAX L_ctermid L_cuserid + stdio_h => [qw(BUFSIZ EOF FILENAME_MAX L_ctermid L_cuserid L_tmpname NULL SEEK_CUR SEEK_END SEEK_SET STREAM_MAX TMP_MAX stderr stdin stdout _IOFBF _IOLBF _IONBF clearerr fclose fdopen feof ferror fflush fgetc fgetpos @@ -83,33 +85,33 @@ $H{stdio_h} = [qw(BUFSIZ EOF FILENAME_MAX L_ctermid L_cuserid fscanf fseek fsetpos ftell fwrite getchar gets perror putc putchar puts remove rewind scanf setbuf setvbuf sscanf tmpfile tmpnam - ungetc vfprintf vprintf vsprintf)]; + ungetc vfprintf vprintf vsprintf)], -$H{stdlib_h} = [qw(EXIT_FAILURE EXIT_SUCCESS MB_CUR_MAX NULL RAND_MAX + stdlib_h => [qw(EXIT_FAILURE EXIT_SUCCESS MB_CUR_MAX NULL RAND_MAX abort atexit atof atoi atol bsearch calloc div free getenv labs ldiv malloc mblen mbstowcs mbtowc - qsort realloc strtod strtol stroul wcstombs wctomb)]; + qsort realloc strtod strtol stroul wcstombs wctomb)], -$H{string_h} = [qw(NULL memchr memcmp memcpy memmove memset strcat + string_h => [qw(NULL memchr memcmp memcpy memmove memset strcat strchr strcmp strcoll strcpy strcspn strerror strlen strncat strncmp strncpy strpbrk strrchr strspn strstr - strtok strxfrm)]; + strtok strxfrm)], -$H{sys_stat_h} = [qw(S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU + sys_stat_h => [qw(S_IRGRP S_IROTH S_IRUSR S_IRWXG S_IRWXO S_IRWXU S_ISBLK S_ISCHR S_ISDIR S_ISFIFO S_ISGID S_ISREG S_ISUID S_IWGRP S_IWOTH S_IWUSR S_IXGRP S_IXOTH S_IXUSR - fstat mkfifo)]; + fstat mkfifo)], -$H{sys_times_h} = [qw()]; + sys_times_h => [qw()], -$H{sys_types_h} = [qw()]; + sys_types_h => [qw()], -$H{sys_utsname_h} = [qw(uname)]; + sys_utsname_h => [qw(uname)], -$H{sys_wait_h} = [qw(WEXITSTATUS WIFEXITED WIFSIGNALED WIFSTOPPED - WNOHANG WSTOPSIG WTERMSIG WUNTRACED)]; + sys_wait_h => [qw(WEXITSTATUS WIFEXITED WIFSIGNALED WIFSTOPPED + WNOHANG WSTOPSIG WTERMSIG WUNTRACED)], -$H{termios_h} = [qw( B0 B110 B1200 B134 B150 B1800 B19200 B200 B2400 + termios_h => [qw( B0 B110 B1200 B134 B150 B1800 B19200 B200 B2400 B300 B38400 B4800 B50 B600 B75 B9600 BRKINT CLOCAL CREAD CS5 CS6 CS7 CS8 CSIZE CSTOPB ECHO ECHOE ECHOK ECHONL HUPCL ICANON ICRNL IEXTEN IGNBRK IGNCR IGNPAR @@ -119,12 +121,12 @@ $H{termios_h} = [qw( B0 B110 B1200 B134 B150 B1800 B19200 B200 B2400 TOSTOP VEOF VEOL VERASE VINTR VKILL VMIN VQUIT VSTART VSTOP VSUSP VTIME cfgetispeed cfgetospeed cfsetispeed cfsetospeed tcdrain - tcflow tcflush tcgetattr tcsendbreak tcsetattr )]; + tcflow tcflush tcgetattr tcsendbreak tcsetattr )], -$H{time_h} = [qw(CLK_TCK CLOCKS_PER_SEC NULL asctime clock ctime - difftime mktime strftime tzset tzname)]; + time_h => [qw(CLK_TCK CLOCKS_PER_SEC NULL asctime clock ctime + difftime mktime strftime tzset tzname)], -$H{unistd_h} = [qw(F_OK NULL R_OK SEEK_CUR SEEK_END SEEK_SET + unistd_h => [qw(F_OK NULL R_OK SEEK_CUR SEEK_END SEEK_SET STRERR_FILENO STDIN_FILENO STDOUT_FILENO W_OK X_OK _PC_CHOWN_RESTRICTED _PC_LINK_MAX _PC_MAX_CANON _PC_MAX_INPUT _PC_NAME_MAX _PC_NO_TRUNC _PC_PATH_MAX @@ -138,28 +140,13 @@ $H{unistd_h} = [qw(F_OK NULL R_OK SEEK_CUR SEEK_END SEEK_SET dup2 dup execl execle execlp execv execve execvp fpathconf getcwd getegid geteuid getgid getgroups getpid getuid isatty lseek pathconf pause setgid setpgid - setsid setuid sysconf tcgetpgrp tcsetpgrp ttyname)]; + setsid setuid sysconf tcgetpgrp tcsetpgrp ttyname)], -$H{utime_h} = [qw()]; + utime_h => [qw()], -sub expand { - local (@mylist); - foreach $entry (@_) { - if ($H{$entry}) { - push(@mylist, @{$H{$entry}}); - } - else { - push(@mylist, $entry); - } - } - @mylist; -} +); -@EXPORT = expand qw(assert_h ctype_h dirent_h errno_h fcntl_h float_h - grp_h limits_h locale_h math_h pwd_h setjmp_h signal_h - stdarg_h stddef_h stdio_h stdlib_h string_h sys_stat_h - sys_times_h sys_types_h sys_utsname_h sys_wait_h - termios_h time_h unistd_h utime_h); +Exporter::export_tags(); @EXPORT_OK = qw( closedir opendir readdir rewinddir @@ -179,9 +166,10 @@ sub expand { utime ); +# Grandfather old foo_h form to new :foo_h form sub import { my $this = shift; - my @list = expand @_; + my @list = map { m/^\w+_h$/ ? ":$_" : $_ } @_; local $Exporter::ExportLevel = 1; Exporter::import($this,@list); } @@ -237,7 +225,7 @@ sub gensym { sub ungensym { local($x) = shift; $x =~ s/.*:://; - delete $::_POSIX{$x}; + delete $POSIX::{$x}; } ############################ @@ -257,7 +245,7 @@ sub new { $mode =~ s/a.*/>>/ || $mode =~ s/w.*/>/ || ($mode = '<'); - open($glob, "$mode $filename"); + open($glob, "$mode $filename") and bless \$glob; } @@ -268,7 +256,7 @@ sub new_from_fd { $mode =~ s/a.*/>>/ || $mode =~ s/w.*/>/ || ($mode = '<'); - open($glob, "$mode&=$fd"); + open($glob, "$mode&=$fd") and bless \$glob; } @@ -280,6 +268,10 @@ sub clearerr { sub close { POSIX::usage "close(filehandle)" if @_ != 1; close($_[0]); +} + +sub DESTROY { + close($_[0]); ungensym($_[0]); } diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs index fbd21c894b..5c2fe2400e 100644 --- a/ext/POSIX/POSIX.xs +++ b/ext/POSIX/POSIX.xs @@ -2412,7 +2412,8 @@ ungetc(handle, c) RETVAL OutputStream -new_tmpfile() +new_tmpfile(packname = "FileHandle") + char * packname CODE: RETVAL = tmpfile(); OUTPUT: @@ -2582,6 +2583,13 @@ open(filename, flags = O_RDONLY, mode = 0666) char * filename int flags Mode_t mode + CODE: + if (flags & (O_APPEND|O_CREAT|O_TRUNC|O_RDWR|O_WRONLY|O_EXCL)) + TAINT_PROPER("open"); + RETVAL = open(filename, flags, mode); + OUTPUT: + RETVAL + HV * localeconv() @@ -2972,7 +2980,7 @@ strxfrm(src) STRLEN dstlen; char *p = SvPV(src,srclen); srclen++; - ST(0) = sv_2mortal(newSV(srclen)); + ST(0) = sv_2mortal(NEWSV(800,srclen)); dstlen = strxfrm(SvPVX(ST(0)), p, (size_t)srclen); if (dstlen > srclen) { dstlen++; @@ -2988,6 +2996,11 @@ SysRet mkfifo(filename, mode) char * filename Mode_t mode + CODE: + TAINT_PROPER("mkfifo"); + RETVAL = mkfifo(filename, mode); + OUTPUT: + RETVAL SysRet tcdrain(fd) @@ -3043,7 +3056,7 @@ clock() char * ctime(time) - Time_t * time + Time_t &time double difftime(time1, time2) diff --git a/ext/SDBM_File/SDBM_File.xs b/ext/SDBM_File/SDBM_File.xs index 97f9c1f9f4..38eaebf5c5 100644 --- a/ext/SDBM_File/SDBM_File.xs +++ b/ext/SDBM_File/SDBM_File.xs @@ -42,7 +42,7 @@ sdbm_STORE(db, key, value, flags = DBM_REPLACE) if (RETVAL) { if (RETVAL < 0 && errno == EPERM) croak("No write permission to sdbm file"); - warn("sdbm store returned %d, errno %d, key \"%s\"", + croak("sdbm store returned %d, errno %d, key \"%s\"", RETVAL,errno,key.dptr); sdbm_clearerr(db); } diff --git a/ext/Socket/Socket.pm b/ext/Socket/Socket.pm index 8e6e097c0c..6c63fb5fe3 100644 --- a/ext/Socket/Socket.pm +++ b/ext/Socket/Socket.pm @@ -86,10 +86,6 @@ require DynaLoader; ); sub AUTOLOAD { - if (@_ > 1) { - $AutoLoader::AUTOLOAD = $AUTOLOAD; - goto &AutoLoader::AUTOLOAD; - } local($constname); ($constname = $AUTOLOAD) =~ s/.*:://; $val = constant($constname, @_ ? $_[0] : 0); @@ -107,6 +103,16 @@ sub AUTOLOAD { goto &$AUTOLOAD; } + +# pack a sockaddr_in structure for use in bind() calls. +# (here to hide the 'S n C4 x8' magic from applications) +sub sockaddr_in{ + my($af, $port, @quad) = @_; + my $pack = 'S n C4 x8'; # lookup $pack from hash using $af? + pack($pack, $af, $port, @quad); +} + + bootstrap Socket; # Preloaded methods go here. Autoload methods go after __END__, and are |