diff --git a/dist/ntp/ntpd/ntp_io.c b/dist/ntp/ntpd/ntp_io.c index 2cc1a7c77ef4..92cccc5b3c51 100644 --- a/dist/ntp/ntpd/ntp_io.c +++ b/dist/ntp/ntpd/ntp_io.c @@ -1,4 +1,4 @@ -/* $NetBSD: ntp_io.c,v 1.12 2005/06/03 16:13:33 lukem Exp $ */ +/* $NetBSD: ntp_io.c,v 1.13 2006/03/18 13:13:25 kardel Exp $ */ /* * ntp_io.c - input/output routines for ntpd. The socket-opening code @@ -1273,6 +1273,9 @@ close_socket( { SOCKET i, newmax; + if (fd == INVALID_SOCKET) + return; + (void) closesocket(fd); /* @@ -1306,6 +1309,9 @@ close_file( { int i, newmax; + if (fd == INVALID_SOCKET) + return; + (void) close(fd); /* * I/O Completion Ports don't care about select and fd_set