summaryrefslogtreecommitdiff
path: root/dist/IO/IO.xs
diff options
context:
space:
mode:
Diffstat (limited to 'dist/IO/IO.xs')
-rw-r--r--dist/IO/IO.xs16
1 files changed, 5 insertions, 11 deletions
diff --git a/dist/IO/IO.xs b/dist/IO/IO.xs
index 4b13feb041..4dc9149983 100644
--- a/dist/IO/IO.xs
+++ b/dist/IO/IO.xs
@@ -566,22 +566,18 @@ sockatmark (sock)
InputStream sock
PROTOTYPE: $
PREINIT:
- int fd = PerlIO_fileno(sock);
+ int fd;
CODE:
- {
-#ifdef HAS_SOCKATMARK
+ fd = PerlIO_fileno(sock);
if (fd < 0) {
errno = EBADF;
RETVAL = -1;
- } else {
+ }
+#ifdef HAS_SOCKATMARK
+ else {
RETVAL = sockatmark(fd);
}
#else
- {
- if (fd < 0) {
- errno = EBADF;
- RETVAL = -1;
- }
else {
int flag = 0;
# ifdef SIOCATMARK
@@ -596,9 +592,7 @@ sockatmark (sock)
# endif
RETVAL = flag;
}
- }
#endif
- }
OUTPUT:
RETVAL