Skip to content

Commit

Permalink
Move "is Windows32" decision to a constant
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Melo <melo@simplicidade.org>
  • Loading branch information
melo committed Sep 4, 2012
1 parent f6c0887 commit 5905431
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/Redis.pm
Expand Up @@ -18,6 +18,7 @@ use Encode;
use Try::Tiny;
use Scalar::Util ();

use constant WIN32 => $^O eq 'MSWin32';


sub new {
Expand Down Expand Up @@ -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; };
}
Expand Down

0 comments on commit 5905431

Please sign in to comment.