Permalink
Browse files

Move "is Windows32" decision to a constant

Signed-off-by: Pedro Melo <melo@simplicidade.org>
  • Loading branch information...
1 parent f6c0887 commit 590543124e047a17ce978f9ced568958c83c3f2f @melo melo committed Sep 4, 2012
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/Redis.pm
View
@@ -18,6 +18,7 @@ use Encode;
use Try::Tiny;
use Scalar::Util ();
+use constant WIN32 => $^O eq 'MSWin32';
sub new {
@@ -605,7 +606,7 @@ sub __try_read_sock {
### Copied from AnyEvent::Util
BEGIN {
- *__fh_nonblocking = ($^O eq 'MSWin32')
+ *__fh_nonblocking = (WIN32)
? sub($$) { ioctl $_[0], 0x8004667e, pack "L", $_[1]; } # FIONBIO
: sub($$) { fcntl $_[0], F_SETFL, $_[1] ? O_NONBLOCK : 0; };
}

0 comments on commit 5905431

Please sign in to comment.