]> git.ozlabs.org Git - petitboot/blobdiff - discover/device-handler.c
Add test case for empty yaboot.conf file
[petitboot] / discover / device-handler.c
index 9e40fb1d71cd09b86dd7fbfcb92248f6cb00548b..0f876658b5a2331750ceeced591bfca53e81f042 100644 (file)
@@ -55,7 +55,7 @@ static struct device device = {
 
 int device_handler_get_current_devices(
                struct device_handler *handler __attribute__((unused)),
-               struct device **devices)
+               const struct device **devices)
 
 {
        *devices = &device;
@@ -227,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;
@@ -320,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;
        }