diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2008-12-15 15:22:34 +1100 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2008-12-15 15:22:34 +1100 |
commit | 32e6a41f33e5576716b351bd473a27939fe94fa1 (patch) | |
tree | 0d6b75ac0a02d2496416095405cb9498777c3beb /discover/pb-discover.c | |
parent | 000a92b4fa909c432732ac3ed8f28eeeaeac70ee (diff) | |
download | talos-petitboot-32e6a41f33e5576716b351bd473a27939fe94fa1.tar.gz talos-petitboot-32e6a41f33e5576716b351bd473a27939fe94fa1.zip |
Initial support for multiple UIs
Move the device discovery code from separate udev helpers to a single
process to listen on two sockets: one SOCK_DGRAM for incoming udev
events, and one SOCK_STREAM for UIs to connect.
Initial support for client/server infrastructure, still need to wire-up
the udev messages.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'discover/pb-discover.c')
-rw-r--r-- | discover/pb-discover.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/discover/pb-discover.c b/discover/pb-discover.c new file mode 100644 index 0000000..45b6ba1 --- /dev/null +++ b/discover/pb-discover.c @@ -0,0 +1,34 @@ + +#include <stdlib.h> +#include <signal.h> + +#include "udev.h" +#include "discover-server.h" +#include "waiter.h" +#include "log.h" + + +int main(void) +{ + struct discover_server *server; + struct udev *udev; + + /* we look for closed sockets when we write, so ignore SIGPIPE */ + signal(SIGPIPE, SIG_IGN); + + udev = udev_init(); + if (!udev) + return EXIT_FAILURE; + + server = discover_server_init(); + if (!server) + return EXIT_FAILURE; + + for (;;) { + if (waiter_poll()) + return EXIT_FAILURE; + } + + + return EXIT_SUCCESS; +} |