Fix event handling after moving callbacks to mbus handle

This commit is contained in:
Stefan Wahren
2013-10-13 21:56:15 +02:00
parent 0cf57bfc35
commit c2a3f4b871
9 changed files with 54 additions and 55 deletions

View File

@ -116,12 +116,6 @@ main(int argc, char **argv)
return 0;
}
if (debug)
{
mbus_register_send_event(&mbus_dump_send_event);
mbus_register_recv_event(&mbus_dump_recv_event);
}
if (addr_mask == NULL)
{
fprintf(stderr, "Failed to allocate address mask.\n");
@ -141,6 +135,12 @@ main(int argc, char **argv)
free(addr_mask);
return 1;
}
if (debug)
{
mbus_register_send_event(handle, &mbus_dump_send_event);
mbus_register_recv_event(handle, &mbus_dump_recv_event);
}
if (mbus_connect(handle) == -1)
{