summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNate Straz <nstraz@redhat.com>2007-02-14 16:36:25 +0000
committerNathan Straz <nstraz@redhat.com>2008-09-23 09:37:47 -0400
commita6522734ec60a5e3d90ef6b0b8ef86039bd61c3e (patch)
treeca4d7c2191e4b26bc1802bf5123c4849f9d26e91
parentcfe91a2ec93a33a8597cf0a3f70a850e567094df (diff)
downloadqarsh-a6522734ec60a5e3d90ef6b0b8ef86039bd61c3e.zip
qarsh-a6522734ec60a5e3d90ef6b0b8ef86039bd61c3e.tar.gz
qarsh-a6522734ec60a5e3d90ef6b0b8ef86039bd61c3e.tar.xz
Every time btimed is restarted we could get a slightly different boot time.
qarsh is the primary user of btimed, but it only sends a btime request when it hasn't received output for 5 seconds. If output is streaming for more than 30 seconds, btimed would exit. When the output quiets down again and btimed starts up, it could get a slightly different uptime and round in the opposite direction.
-rw-r--r--btimed.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/btimed.c b/btimed.c
index 67f9e30..6633967 100644
--- a/btimed.c
+++ b/btimed.c
@@ -54,9 +54,6 @@ main(int argc, char **argv)
/* Running out of (x)inetd the socket was duped onto stdin. */
sd = fileno(stdin);
- /* We want to exit after 30 seconds of inactivity */
- alarm(30);
-
/* Generate the standard btime message */
memset(btimeonly, 0, BTIME_MSGLEN);
local_btime = get_btime();
@@ -71,8 +68,8 @@ main(int argc, char **argv)
(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.
+ /* Bail if we get an error. client side resends
+ * request, no need to retry here.
*/
syslog(LOG_INFO, "exitting");
exit(0);
@@ -90,8 +87,6 @@ main(int argc, char **argv)
sendto(sd, outmsg, BTIME_MSGLEN, MSG_DONTWAIT,
(struct sockaddr *)&cli_addr, cli_addr_len);
- /* We want to exit after 30 seconds of inactivity */
- alarm(30);
}
return 0;