Prettify
[handlervirt.git] / node / main.c
blob8fef498f2081d167070b71314a3023fd8542222f
1 #include <stdio.h>
2 #include <stdlib.h>
4 #include <avahi-client/client.h>
5 #include <avahi-common/simple-watch.h>
7 #include "node.h"
9 int main(AVAHI_GCC_UNUSED int argc, AVAHI_GCC_UNUSED char*argv[]) {
10 /* Allocate main loop object */
11 if (!(simple_poll = avahi_simple_poll_new())) {
12 fprintf(stderr, "Failed to create simple poll object.\n");
13 goto fail;
16 /* The client that is going to do the work */
17 client_callback(NULL, AVAHI_CLIENT_FAILURE, NULL);
19 /* Run the main loop */
20 avahi_simple_poll_loop(simple_poll);
22 fail:
23 /* Cleanup things */
24 if (simple_poll)
25 avahi_simple_poll_free(simple_poll);
27 exit(EXIT_SUCCESS);