diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2001-04-07 14:59:20 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2001-04-07 14:59:20 +0000 |
commit | 06c912bcf3d3083501038850d155b5aa2b160ace (patch) | |
tree | db369333587b01aab78276f11b68a3976c9851c7 /ext/IO | |
parent | 800b4dc45ee0b7a1fe78774d426afa0152fd5178 (diff) | |
download | perl-06c912bcf3d3083501038850d155b5aa2b160ace.tar.gz |
atmark() code cleanaup.
p4raw-id: //depot/perl@9608
Diffstat (limited to 'ext/IO')
-rw-r--r-- | ext/IO/IO.xs | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/ext/IO/IO.xs b/ext/IO/IO.xs index 3abc94b274..316075f001 100644 --- a/ext/IO/IO.xs +++ b/ext/IO/IO.xs @@ -420,20 +420,24 @@ sockatmark (sock) InputStream sock PROTOTYPE: $ PREINIT: - int fd,flag=0; + int fd; CODE: { fd = PerlIO_fileno(sock); #ifdef HAS_SOCKATMARK - flag = sockatmark(fd); + RETVAL = sockatmark(fd); #else # ifdef SIOCATMARK - if (ioctl(fd, SIOCATMARK, &flag) != 0) - XSRETURN_UNDEF; + { + int flag = 0; + + if (ioctl(fd, SIOCATMARK, &flag) != 0) + XSRETURN_UNDEF; # else - not_here("IO::Socket::atmark"); -# endif - RETVAL = flag; + not_here("IO::Socket::atmark"); +# endif + RETVAL = flag; + } #endif } OUTPUT: |