summaryrefslogtreecommitdiffstats
path: root/btimed.c
diff options
context:
space:
mode:
Diffstat (limited to 'btimed.c')
-rw-r--r--btimed.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/btimed.c b/btimed.c
index 0a3b609..ee758d6 100644
--- a/btimed.c
+++ b/btimed.c
@@ -45,6 +45,13 @@ main(int argc, char **argv)
nbytes = recvfrom(sd, &inmsg, BTIME_MSGLEN, MSG_WAITALL,
(struct sockaddr *)&cli_addr, &cli_addr_len);
+ if (nbytes < 0) {
+ /* Bail, we may have had an alarm(), or other error.
+ * client side resends request, no need to retry here.
+ */
+ exit(0);
+ }
+
sendto(sd, &outmsg, BTIME_MSGLEN, MSG_DONTWAIT,
(struct sockaddr *)&cli_addr, cli_addr_len);
/* We want to exit after 30 seconds of inactivity */