ports/166797: [patch] devel/p5-Sys-Syscall: fix sendfile_freebsd

Mel Flynn rflynn at acsalaska.net
Mon Apr 9 19:00:34 UTC 2012


>Number:         166797
>Category:       ports
>Synopsis:       [patch] devel/p5-Sys-Syscall: fix sendfile_freebsd
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Apr 09 19:00:29 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Mel Flynn
>Release:        FreeBSD 8.2-STABLE amd64
>Organization:
>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 at 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 ---

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list