]> git.ozlabs.org Git - petitboot/blobdiff - discover/device-handler.c
Cleanup --dry-run option code
[petitboot] / discover / device-handler.c
index 0783181147edab9f0f8c6b7de9fa2ea35c516cb8..6e03ef3fa159136b6015983a0054411cb7f126c8 100644 (file)
@@ -201,7 +201,7 @@ static int mount_device(struct discover_context *ctx)
        argv[4] = "ro";
        argv[5] = NULL;
 
        argv[4] = "ro";
        argv[5] = NULL;
 
-       if (pb_run_cmd(argv, 1)) {
+       if (pb_run_cmd(argv, 1, 0)) {
 
                /* Retry mount without ro option. */
 
 
                /* Retry mount without ro option. */
 
@@ -210,7 +210,7 @@ static int mount_device(struct discover_context *ctx)
                argv[2] = ctx->mount_path;
                argv[3] = NULL;
 
                argv[2] = ctx->mount_path;
                argv[3] = NULL;
 
-               if (pb_run_cmd(argv, 1))
+               if (pb_run_cmd(argv, 1, 0))
                        goto out_rmdir;
        }
 
                        goto out_rmdir;
        }
 
@@ -294,11 +294,7 @@ static int handle_add_udev_event(struct device_handler *handler,
        ctx->id = talloc_strdup(ctx, event->device);
 
        devname = event_get_param(ctx->event, "DEVNAME");
        ctx->id = talloc_strdup(ctx, event->device);
 
        devname = event_get_param(ctx->event, "DEVNAME");
-       if (!devname) {
-               pb_log("no devname for %s?\n", event->device);
-               return 0;
-       }
-
+       assert(devname);
        ctx->device_path = talloc_strdup(ctx, devname);
 
        rc = mount_device(ctx);
        ctx->device_path = talloc_strdup(ctx, devname);
 
        rc = mount_device(ctx);