From: Jarkko Hietaniemi Date: Sat, 7 Apr 2001 14:59:20 +0000 (+0000) Subject: atmark() code cleanaup. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=06c912bcf3d3083501038850d155b5aa2b160ace;p=p5sagit%2Fp5-mst-13.2.git atmark() code cleanaup. p4raw-id: //depot/perl@9608 --- diff --git a/ext/IO/IO.xs b/ext/IO/IO.xs index 3abc94b..316075f 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: