Message-Id: <
200012040306.eB436rE18922@garcia.efn.org>
p4raw-id: //depot/perl@7976
#include <fcntl.h>
#define PERLIO_NOT_STDIO 0
+
#include "EXTERN.h"
#include "perl.h"
PerlIOStdio_close(PerlIO *f)
{
dTHX;
+#ifdef HAS_SOCKET
int optval, optlen = sizeof(int);
+#endif
FILE *stdio = PerlIOSelf(f,PerlIOStdio)->stdio;
return(
+#ifdef HAS_SOCKET
(getsockopt(PerlIO_fileno(f), SOL_SOCKET, SO_TYPE, (char *)&optval, &optlen) < 0) ?
PerlSIO_fclose(stdio) :
- close(PerlIO_fileno(f)));
+ close(PerlIO_fileno(f))
+#else
+ PerlSIO_fclose(stdio)
+#endif
+ );
+
}
IV