X-Git-Url: http://git.ozlabs.org/?p=petitboot;a=blobdiff_plain;f=discover%2Fdevice-handler.c;h=0f876658b5a2331750ceeced591bfca53e81f042;hp=c7e0227f242529d0673c22655c4064a5daf8e930;hb=1d8d12aceeb41c2cde4736fe4c9926cbc9cf38d4;hpb=89ccc8e6dc81bc1d613454b9944c2f3324d43e2a diff --git a/discover/device-handler.c b/discover/device-handler.c index c7e0227..0f87665 100644 --- a/discover/device-handler.c +++ b/discover/device-handler.c @@ -8,13 +8,13 @@ #include #include +#include #include #include "device-handler.h" #include "discover-server.h" #include "parser.h" #include "udev.h" -#include "log.h" #include "paths.h" #define MOUNT_BIN "/bin/mount" @@ -53,8 +53,9 @@ static struct device device = { .icon_file = "meep.png", }; -int device_handler_get_current_devices(struct device_handler *handler, - struct device **devices) +int device_handler_get_current_devices( + struct device_handler *handler __attribute__((unused)), + const struct device **devices) { *devices = &device; @@ -226,8 +227,11 @@ static int mount_device(struct discover_context *ctx) goto out_rmdir; } - if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) + if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) { + pb_log("%s: mount failed (%d): %s\n", __func__, + WEXITSTATUS(status), ctx->event->device); goto out_rmdir; + } setup_device_links(ctx); return 0; @@ -319,7 +323,6 @@ static int handle_add_event(struct device_handler *handler, rc = mount_device(ctx); if (rc) { - pb_log("mount_device failed for %s\n", event->device); talloc_free(ctx); return 0; } @@ -377,7 +380,7 @@ int device_handler_event(struct device_handler *handler, struct device_handler *device_handler_init(struct discover_server *server) { struct device_handler *handler; - int i; + unsigned int i; handler = talloc(NULL, struct device_handler); handler->devices = NULL;