summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4ac0a75)
raw | patch | inline | side by side (parent: 4ac0a75)
author | octo <octo> | |
Thu, 1 Jun 2006 07:17:11 +0000 (07:17 +0000) | ||
committer | octo <octo> | |
Thu, 1 Jun 2006 07:17:11 +0000 (07:17 +0000) |
src/ntpd.c | patch | blob | history |
diff --git a/src/ntpd.c b/src/ntpd.c
index 40c2aa47053ad5629392fd5e48be2b368d5ba8a4..e6d0ae281e5285e273db50d91834a7d66c764e96 100644 (file)
--- a/src/ntpd.c
+++ b/src/ntpd.c
if (status < 0)
{
DBG ("recv(2) failed: %s", strerror (errno));
+ DBG ("Closing socket #%i", sd);
+ close (sd);
+ sock_descr = sd = -1;
return (-1);
}
@@ -758,7 +761,12 @@ static int ntpd_send_request (int req_code, int req_items, int req_size, char *r
status = swrite (sd, (const char *) &req, REQ_LEN_NOMAC);
if (status < 0)
+ {
+ DBG ("`swrite' failed. Closing socket #%i", sd);
+ close (sd);
+ sock_descr = sd = -1;
return (status);
+ }
return (0);
}