Date: Mon, 9 Apr 2012 10:56:30 -0800 (AKDT) From: Mel Flynn <rflynn@acsalaska.net> To: FreeBSD-gnats-submit@freebsd.org Cc: Steve Wills <swills@freebsd.org>, Maintainer <perl@freebsd.org> Subject: [patch] devel/p5-Sys-Syscall: fix sendfile_freebsd Message-ID: <201204091856.q39IuUjG093498@datakitty.lan.rachie.is-a-geek.net>
next in thread | raw e-mail | index | archive | help
>Submitter-Id: current-users >Originator: Mel Flynn >Organization: >Confidential: no >Synopsis: [patch] devel/p5-Sys-Syscall: fix sendfile_freebsd >Severity: serious >Priority: low >Category: ports >Class: sw-bug >Release: FreeBSD 8.2-STABLE amd64 >Environment: System: FreeBSD datakitty.lan.rachie.is-a-geek.net 8.2-STABLE FreeBSD 8.2-STABLE #6 r230977: Sun Feb 5 06:20:11 AKST 2012 mel@datakitty.lan.rachie.is-a-geek.net:/data/obj/data/RELENG_8/src/sys/GENERIC amd64 >Description: The sendfile implementation in Sys-Syscall does not actually work, due to reversal of arguments in POSIX::lseek and incorrect handling of EAGAIN. >How-To-Repeat: >Fix: Obtained from: https://rt.cpan.org/Public/Bug/Display.html?id=17326 with slight modification. --- devel__p5-Sys-Syscall.patch begins here --- diff -urN --exclude CVS --exclude '*~' --exclude '.#*' --exclude '*.orig' --exclude '*.rej' devel/p5-Sys-Syscall/Makefile /usr/ports/devel/p5-Sys-Syscall/Makefile --- devel/p5-Sys-Syscall/Makefile.orig 2010-05-10 05:11:25.000000000 -0800 +++ devel/p5-Sys-Syscall/Makefile 2012-04-09 10:47:36.000000000 -0800 @@ -7,6 +7,7 @@ PORTNAME= Sys-Syscall PORTVERSION= 0.23 +PORTREVISION= 1 CATEGORIES= devel perl5 MASTER_SITES= CPAN MASTER_SITE_SUBDIR= Sys diff -urN --exclude CVS --exclude '*~' --exclude '.#*' --exclude '*.orig' --exclude '*.rej' devel/p5-Sys-Syscall/files/patch-lib__Sys__Syscall.pm /usr/ports/devel/p5-Sys-Syscall/files/patch-lib__Sys__Syscall.pm --- /dev/null 1969-12-31 14:00:00.000000000 -1000 +++ devel/p5-Sys-Syscall/files/patch-lib__Sys__Syscall.pm 2012-04-09 09:55:22.000000000 -0800 @@ -0,0 +1,30 @@ +--- lib/Sys/Syscall.pm.orig 2010-04-18 17:51:10.000000000 -0800 ++++ lib/Sys/Syscall.pm 2012-04-09 08:39:07.000000000 -0800 +@@ -2,7 +2,7 @@ + + package Sys::Syscall; + use strict; +-use POSIX qw(ENOSYS SEEK_CUR); ++use POSIX qw(ENOSYS EAGAIN SEEK_CUR); + use Config; + + require Exporter; +@@ -180,12 +180,14 @@ + 0, # struct sf_hdtr *hdtr + $sbytes_buf, # off_t *sbytes + 0); # flags +- return $rv if $rv < 0; ++ return $rv if $rv < 0 && $! != EAGAIN; + + +- my $set = unpack("L", $sbytes_buf); +- POSIX::lseek($_[1]+0, SEEK_CUR, $set); +- return $set; ++ if (my $set = unpack("L", $sbytes_buf)) { ++ POSIX::lseek($_[1]+0, $set, SEEK_CUR); ++ return $set; ++ } ++ return $rv < 0 ? $rv : 0; + } + + --- devel__p5-Sys-Syscall.patch ends here ---
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201204091856.q39IuUjG093498>