Fix setting a non-blocking mode in IO::Socket::UNIX

This commit is contained in:
Petr Písař 2020-08-05 13:22:34 +02:00
parent f3d99a835e
commit 87c764208f
2 changed files with 68 additions and 0 deletions

View File

@ -0,0 +1,61 @@
From c6439962c995d4d7052af9fb3f92da93c1584b84 Mon Sep 17 00:00:00 2001
From: vividsnow <vividsnow@gmail.com>
Date: Fri, 31 Jul 2020 00:37:58 +0300
Subject: [PATCH] IO::Socket::UNIX: synchronize behavior with module
documentation (#17787)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* synchronize behavior with module documentation
IO::Socket docs states that passing Blocking => 0 will be set socket to non-blocking mode
* Update AUTHORS
* bump version
Signed-off-by: Petr Písař <ppisar@redhat.com>
---
AUTHORS | 1 +
dist/IO/lib/IO/Socket/UNIX.pm | 6 +++++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/AUTHORS b/AUTHORS
index 577ba7d0ee..299fdec8a8 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1293,6 +1293,7 @@ Ville Skyttä <scop@cs132170.pp.htv.fi>
Vincent Pit <perl@profvince.com>
Vishal Bhatia <vishal@deja.com>
Vitali Peil <vitali.peil@uni-bielefeld.de>
+vividsnow <vividsnow@gmail.com>
Vlad Harchev <hvv@hippo.ru>
Vladimir Alexiev <vladimir@cs.ualberta.ca>
Vladimir Marek <vlmarek@volny.cz>
diff --git a/dist/IO/lib/IO/Socket/UNIX.pm b/dist/IO/lib/IO/Socket/UNIX.pm
index 04b36eaf74..14d0b27a8c 100644
--- a/dist/IO/lib/IO/Socket/UNIX.pm
+++ b/dist/IO/lib/IO/Socket/UNIX.pm
@@ -11,7 +11,7 @@ use IO::Socket;
use Carp;
our @ISA = qw(IO::Socket);
-our $VERSION = "1.41";
+our $VERSION = "1.42";
IO::Socket::UNIX->register_domain( AF_UNIX );
@@ -30,6 +30,10 @@ sub configure {
$sock->socket(AF_UNIX, $type, 0) or
return undef;
+ if(exists $arg->{Blocking}) {
+ $sock->blocking($arg->{Blocking}) or
+ return undef;
+ }
if(exists $arg->{Local}) {
my $addr = sockaddr_un($arg->{Local});
$sock->bind($addr) or
--
2.25.4

View File

@ -183,6 +183,10 @@ Patch19: perl-5.33.0-IO-Handle-clear-the-error-on-both-input-and-output-s
# Fix a link to Unicode Technical Standard #18, GH#17881, in upstream after 5.33.0 # Fix a link to Unicode Technical Standard #18, GH#17881, in upstream after 5.33.0
Patch20: perl-5.32.0-Fix-404-and-text-in-New-Unicode-properties-section.patch Patch20: perl-5.32.0-Fix-404-and-text-in-New-Unicode-properties-section.patch
# Fix setting a non-blocking mode in IO::Socket::UNIX, GH#17787,
# in upstream after 5.33.0
Patch21: perl-5.33.0-IO-Socket-UNIX-synchronize-behavior-with-module-docu.patch
# Link XS modules to libperl.so with EU::CBuilder on Linux, bug #960048 # Link XS modules to libperl.so with EU::CBuilder on Linux, bug #960048
Patch200: perl-5.16.3-Link-XS-modules-to-libperl.so-with-EU-CBuilder-on-Li.patch Patch200: perl-5.16.3-Link-XS-modules-to-libperl.so-with-EU-CBuilder-on-Li.patch
@ -4189,6 +4193,7 @@ you're not running VMS, this module does nothing.
%patch18 -p1 %patch18 -p1
%patch19 -p1 %patch19 -p1
%patch20 -p1 %patch20 -p1
%patch21 -p1
%patch200 -p1 %patch200 -p1
%patch201 -p1 %patch201 -p1
@ -4216,6 +4221,7 @@ perl -x patchlevel.h \
'Fedora Patch18: Fix IO::Handle::error() to report write errors (GH#6799)' \ 'Fedora Patch18: Fix IO::Handle::error() to report write errors (GH#6799)' \
'Fedora Patch19: Fix IO::Handle::error() to report write errors (GH#6799)' \ 'Fedora Patch19: Fix IO::Handle::error() to report write errors (GH#6799)' \
'Fedora Patch20: Fix a link to Unicode Technical Standard #18 (GH#17881)' \ 'Fedora Patch20: Fix a link to Unicode Technical Standard #18 (GH#17881)' \
'Fedora Patch21: Fix setting a non-blocking mode in IO::Socket::UNIX (GH#17787)' \
'Fedora Patch200: Link XS modules to libperl.so with EU::CBuilder on Linux' \ 'Fedora Patch200: Link XS modules to libperl.so with EU::CBuilder on Linux' \
'Fedora Patch201: Link XS modules to libperl.so with EU::MM on Linux' \ 'Fedora Patch201: Link XS modules to libperl.so with EU::MM on Linux' \
%{nil} %{nil}
@ -6940,6 +6946,7 @@ popd
- Fix ext/XS-APItest/t/utf8_warn_base.pl tests - Fix ext/XS-APItest/t/utf8_warn_base.pl tests
- Fix IO::Handle::error() to report write errors (GH#6799) - Fix IO::Handle::error() to report write errors (GH#6799)
- Fix a link to Unicode Technical Standard #18 (GH#17881) - Fix a link to Unicode Technical Standard #18 (GH#17881)
- Fix setting a non-blocking mode in IO::Socket::UNIX (GH#17787)
* Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4:5.32.0-458 * Tue Jul 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 4:5.32.0-458
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild