Skip to content

Commit

Permalink
Don't print a message unless there is a problem.
Browse files Browse the repository at this point in the history
  • Loading branch information
kr committed Nov 19, 2008
1 parent 8ddcce9 commit 382723c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 3 additions & 2 deletions net.c
Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 1 addition & 2 deletions prot.c
Expand Up @@ -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]++;

Expand Down

0 comments on commit 382723c

Please sign in to comment.