/*
* If we get here, then fd is actually a socket.
*/
- Newz(1310, fp, 1, FILE);
+ Newz(1310, fp, 1, FILE); /* XXX leak, good thing this code isn't used */
if(fp == NULL) {
errno = ENOMEM;
return NULL;
int
my_fclose (FILE *pf)
{
- int osf, retval;
+ int osf;
if (!wsock_started) /* No WinSock? */
return(fclose(pf)); /* Then not a socket. */
osf = TO_SOCKET(fileno(pf));/* Get it now before it's gone! */
- retval = fclose(pf); /* Must fclose() before closesocket() */
if (osf != -1
&& closesocket(osf) == SOCKET_ERROR
&& WSAGetLastError() != WSAENOTSOCK)
{
+ (void)fclose(pf);
return EOF;
}
- return retval;
+ else
+ return fclose(pf);
}
struct hostent *