Patches for Perl binding

Dave Evans memcached-list-20040309@djce.org.uk
Fri, 19 Mar 2004 18:57:41 +0000


This is a multi-part message in MIME format.
--------------040508090502070300090201
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

Hello,

Please find attached for your consideration two patches for the Perl
binding (Cache::Memcached).

"perl56compat.patch" provides Perl 5.6 compatibility, simply by using
$!==EWOULDBLOCK (etc) instead of the Perl-5.8-specific construct
$!{EWOULDBLOCK}.  I haven't tested it on Perls earlier than 5.6, but it
made the difference for 5.6.1.

"undef.patch" initialises two variables before calling select(), thus
fixing the "use of uninitialised value" errors which previously often
occurred (assuming warnings were enabled).

Bye,

-- 
Dave

PGP key: http://rudolf.org.uk/pgpkey

--------------040508090502070300090201
Content-Type: text/plain;
 name="perl56compat.patch"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filename="perl56compat.patch"

LS0tIE1lbWNhY2hlZC5wbQlGcmkgTWFyIDE5IDE0OjIxOjQyIDIwMDQKKysrIE1lbWNhY2hl
ZC5wbQlGcmkgTWFyIDE5IDE0OjIxOjIxIDIwMDQKQEAgLTEyLDYgKzEyLDcgQEAKIHVzZSBT
dG9yYWJsZSAoKTsKIHVzZSBTb2NrZXQgcXcoTVNHX05PU0lHTkFMIFBGX0lORVQgU09DS19T
VFJFQU0pOwogdXNlIElPOjpIYW5kbGUgKCk7Cit1c2UgRXJybm8gcXcoIEVJTlBST0dSRVNT
IEVXT1VMREJMT0NLIEVJU0NPTk4gKTsKIAogQkVHSU4gewogICAgIGV2YWwgInVzZSBUaW1l
OjpIaVJlcyBxdyAoYWxhcm0pOyI7CkBAIC0xMzEsNyArMTMyLDcgQEAKIAogICAgIG15ICRy
ZXQgPSBjb25uZWN0KCRzb2NrLCAkc2luKTsKIAotICAgIGlmICghJHJldCAmJiAkdGltZW91
dCAmJiAkIXsnRUlOUFJPR1JFU1MnfSkgeworICAgIGlmICghJHJldCAmJiAkdGltZW91dCAm
JiAkIT09RUlOUFJPR1JFU1MpIHsKIAogICAgICAgICBteSAkd2luPScnOwogICAgICAgICB2
ZWMoJHdpbiwgZmlsZW5vKCRzb2NrKSwgMSkgPSAxOwpAQCAtMTM5LDcgKzE0MCw3IEBACiAg
ICAgICAgIGlmIChzZWxlY3QodW5kZWYsICR3aW4sIHVuZGVmLCAkdGltZW91dCkgPiAwKSB7
CiAgICAgICAgICAgICAkcmV0ID0gY29ubmVjdCgkc29jaywgJHNpbik7CiAgICAgICAgICAg
ICAjIEVJU0NPTk4gbWVhbnMgY29ubmVjdGVkICYgd29uJ3QgcmUtY29ubmVjdCwgc28gc3Vj
Y2VzcwotICAgICAgICAgICAgJHJldCA9IDEgaWYgISRyZXQgJiYgJCF7J0VJU0NPTk4nfTsK
KyAgICAgICAgICAgICRyZXQgPSAxIGlmICEkcmV0ICYmICQhPT1FSVNDT05OOwogICAgICAg
ICB9CiAgICAgfQogCkBAIC00NDksNyArNDUwLDcgQEAKICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICRzdGF0ZXskc29ja30gLSAkb2Zmc2V0eyRzb2NrfSwKICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICRvZmZzZXR7JHNvY2t9KTsKICAgICAgICAgICAgIHJldHVybgotICAg
ICAgICAgICAgICAgIGlmICFkZWZpbmVkKCRyZXMpIGFuZCAkIXtFV09VTERCTE9DS307Cisg
ICAgICAgICAgICAgICAgaWYgIWRlZmluZWQoJHJlcykgYW5kICQhPT1FV09VTERCTE9DSzsK
ICAgICAgICAgICAgIGlmICgkcmVzID09IDApIHsgIyBjYXRjaGVzIDA9Y29ubiBjbG9zZWQg
b3IgdW5kZWY9ZXJyb3IKICAgICAgICAgICAgICAgICAkZGVhZC0+KCRzb2NrKTsKICAgICAg
ICAgICAgICAgICByZXR1cm47CkBAIC00NjgsNyArNDY5LDcgQEAKICAgICAgICAgJHJlcyA9
IHN5c3JlYWQoJHNvY2ssICRidWZ7JHNvY2t9LAogICAgICAgICAgICAgICAgICAgICAgICAy
MDQ4LCAkb2Zmc2V0eyRzb2NrfSk7CiAgICAgICAgIHJldHVybgotICAgICAgICAgICAgaWYg
IWRlZmluZWQoJHJlcykgYW5kICQhe0VXT1VMREJMT0NLfTsKKyAgICAgICAgICAgIGlmICFk
ZWZpbmVkKCRyZXMpIGFuZCAkIT09RVdPVUxEQkxPQ0s7CiAgICAgICAgIGlmICgkcmVzID09
IDApIHsKICAgICAgICAgICAgICRkZWFkLT4oJHNvY2spOwogICAgICAgICAgICAgcmV0dXJu
OwpAQCAtNTI2LDcgKzUyNyw3IEBACiAKICAgICAgICAgJHJlcyA9IHNlbmQoJHNvY2ssICRi
dWZ7JHNvY2t9LCAkRkxBR19OT1NJR05BTCk7CiAgICAgICAgIHJldHVybgotICAgICAgICAg
ICAgaWYgbm90IGRlZmluZWQgJHJlcyBhbmQgJCF7RVdPVUxEQkxPQ0t9OworICAgICAgICAg
ICAgaWYgbm90IGRlZmluZWQgJHJlcyBhbmQgJCE9PUVXT1VMREJMT0NLOwogICAgICAgICB1
bmxlc3MgKCRyZXMgPiAwKSB7CiAgICAgICAgICAgICAkZGVhZC0+KCRzb2NrKTsKICAgICAg
ICAgICAgIHJldHVybjsK
--------------040508090502070300090201
Content-Type: text/plain;
 name="undef.patch"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
 filename="undef.patch"

LS0tIE1lbWNhY2hlZC5wbQlUdWUgRmViICAzIDE4OjI3OjQzIDIwMDQKKysrIE1lbWNhY2hl
ZC5wbQlGcmkgTWFyIDE5IDE0OjIxOjQyIDIwMDQKQEAgLTU1Miw3ICs1NTIsNyBAQAogICAg
IHdoaWxlKDEpIHsKICAgICAgICAgaWYgKCRhY3RpdmVfY2hhbmdlZCkgewogICAgICAgICAg
ICAgbGFzdCB1bmxlc3MgJXJlYWRpbmcgb3IgJXdyaXRpbmc7ICMgbm8gc29ja2V0cyBsZWZ0
PwotICAgICAgICAgICAgKCRyaW4sICR3aW4pID0gKHVuZGVmLCB1bmRlZik7CisgICAgICAg
ICAgICAoJHJpbiwgJHdpbikgPSAoJycsICcnKTsKICAgICAgICAgICAgIGZvcmVhY2ggKGtl
eXMgJXJlYWRpbmcpIHsKICAgICAgICAgICAgICAgICB2ZWMoJHJpbiwgZmlsZW5vKCRfKSwg
MSkgPSAxOwogICAgICAgICAgICAgfQo=
--------------040508090502070300090201--