Permalink
Browse files

Don't print a message unless there is a problem.

  • Loading branch information...
1 parent 8ddcce9 commit 382723cca3a4bb907442b281ad5dda97b48be8e2 @kr committed Nov 19, 2008
Showing with 4 additions and 4 deletions.
  1. +3 −2 net.c
  2. +1 −2 prot.c
View
5 net.c
@@ -26,7 +26,7 @@ static int listen_socket = -1;
static struct event listen_evq;
static evh accept_handler;
static time_t main_deadline = 0;
-static int brakes_are_on = 1;
+static int brakes_are_on = 1, after_startup = 0;
int
make_server_socket(struct in_addr host_addr, int port)
@@ -87,7 +87,8 @@ unbrake(evh h)
if (!brakes_are_on) return;
brakes_are_on = 0;
- twarnx("releasing the brakes");
+ if (after_startup) twarnx("releasing the brakes");
+ after_startup = 1;
accept_handler = h ? : accept_handler;
event_set(&listen_evq, listen_socket, EV_READ | EV_PERSIST,
View
3 prot.c
@@ -1226,8 +1226,7 @@ dispatch_cmd(conn c)
case OP_TOUCH:
errno = 0;
id = strtoull(c->cmd + CMD_TOUCH_LEN, &end_buf, 10);
- perror("strtoull");
- if (errno) return reply_msg(c, MSG_BAD_FORMAT);
+ if (errno) return twarn("strtoull"), reply_msg(c, MSG_BAD_FORMAT);
op_ct[type]++;

0 comments on commit 382723c

Please sign in to comment.