summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-02-13 21:11:25 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-02-13 21:11:25 +0000
commita8c306ae9caebf43d96450a54df0a5efad2fe859 (patch)
treeac0538e88bed305c264bc59c884e6f74d3becef9
parent6d80ee83499000660ee1f084b5f4a9fefa8d2029 (diff)
downloadperl-a8c306ae9caebf43d96450a54df0a5efad2fe859.tar.gz
Fix an fcntl example in perlopentut, spotted by MJD.
p4raw-id: //depot/perl@22301
-rw-r--r--pod/perlopentut.pod4
1 files changed, 3 insertions, 1 deletions
diff --git a/pod/perlopentut.pod b/pod/perlopentut.pod
index 0b60096f24..3116f785c1 100644
--- a/pod/perlopentut.pod
+++ b/pod/perlopentut.pod
@@ -723,7 +723,9 @@ With descriptors that you haven't opened using C<sysopen>, such as
sockets, you can set them to be non-blocking using C<fcntl>:
use Fcntl;
- fcntl(Connection, F_SETFL, O_NONBLOCK)
+ my $old_flags = fcntl($handle, F_GETFL, 0)
+ or die "can't get flags: $!";
+ fcntl($handle, F_SETFL, $old_flags | O_NONBLOCK)
or die "can't set non blocking: $!";
Rather than losing yourself in a morass of twisting, turning C<ioctl>s,