Skip to content

Commit

Permalink
Log the source of monitor errors
Browse files Browse the repository at this point in the history
  • Loading branch information
lakeman committed Oct 3, 2014
1 parent b33b0e7 commit 98ffa90
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,10 @@ int monitor_setup_sockets()
return -1;
}

int monitor_write_error(struct monitor_context *c, const char *error){
#define monitor_write_error(C,E) _monitor_write_error(__WHENCE__, C, E)
static int _monitor_write_error(struct __sourceloc __whence, struct monitor_context *c, const char *error){
char msg[256];
WHY(error);
snprintf(msg, sizeof(msg), "\nERROR:%s\n", error);
write_str(c->alarm.poll.fd, msg);
return -1;
Expand Down

0 comments on commit 98ffa90

Please sign in to comment.