diff options
author | Dean Jansa <djansa@redhat.com> | 2006-02-08 16:43:55 +0000 |
---|---|---|
committer | Nathan Straz <nstraz@redhat.com> | 2008-09-23 09:37:45 -0400 |
commit | 8ee2fbe0cdf8a03ae041eaffc2042d072f5b237d (patch) | |
tree | 2e2d7398a0003bdc3ed9e21e086015ca7932dc5c | |
parent | bd81fc6b03f2487050a2eebd7106f7416e178705 (diff) | |
download | qarsh-8ee2fbe0cdf8a03ae041eaffc2042d072f5b237d.tar.gz qarsh-8ee2fbe0cdf8a03ae041eaffc2042d072f5b237d.tar.xz qarsh-8ee2fbe0cdf8a03ae041eaffc2042d072f5b237d.zip |
Bail out if our recvfrom fails due to alarm or error -- client side resends requests so no need to retry in server
-rw-r--r-- | btimed.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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 */ |