Skip to content

Commit

Permalink
#31: Fix merge derp, make it actually work again
Browse files Browse the repository at this point in the history
  • Loading branch information
mcdope committed Jul 14, 2024
1 parent 538d50d commit 1aca921
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/conf.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ static int pusb_conf_parse_device(
pusb_conf_device_get_property(opts, doc, "vendor", opts->device_list[deviceIndex].vendor, sizeof(opts->device_list[deviceIndex].vendor), deviceId);
pusb_conf_device_get_property(opts, doc, "model", opts->device_list[deviceIndex].model, sizeof(opts->device_list[deviceIndex].model), deviceId);

if (!pusb_conf_device_get_property(opts, doc, "serial", opts->device.serial, sizeof(opts->device.serial), deviceId))
if (!pusb_conf_device_get_property(opts, doc, "serial", opts->device_list[deviceIndex].serial, sizeof(opts->device_list[deviceIndex].serial), deviceId))
{
return 0;
}

pusb_conf_device_get_property(opts, doc, "volume_uuid", opts->device.volume_uuid, sizeof(opts->device.volume_uuid), deviceId);
pusb_conf_device_get_property(opts, doc, "volume_uuid", opts->device_list[deviceIndex].volume_uuid, sizeof(opts->device_list[deviceIndex].volume_uuid), deviceId);
return 1;
}

Expand Down Expand Up @@ -221,6 +221,9 @@ int pusb_conf_parse(
log_error("DBG: found device\n");
log_error("DBG: name: %s\n", opts->device_list[currentDevice].name);
log_error("DBG: vendor: %s\n", opts->device_list[currentDevice].vendor);
log_error("DBG: model: %s\n", opts->device_list[currentDevice].model);
log_error("DBG: serial: %s\n", opts->device_list[currentDevice].serial);
log_error("DBG: volume_uuid: %s\n", opts->device_list[currentDevice].volume_uuid);
}

if (!pusb_conf_parse_options(opts, doc, user, service))
Expand Down
2 changes: 2 additions & 0 deletions src/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,15 @@ static int pusb_device_connected(t_pusb_options *opts, UDisksClient *udisks)

log_error("Searching for \"%s\" in the hardware database...\n", opts->device_list[currentDevice].name);

log_debug("Found %d drives to check/iterate...\n", g_list_length(objects));
for (i = 0; i < g_list_length(objects); ++i)
{
object = UDISKS_OBJECT(g_list_nth(objects, i)->data);
if (udisks_object_peek_drive(object))
{
drive = udisks_object_get_drive(object);
retval = strcmp(udisks_drive_get_serial(drive), opts->device_list[currentDevice].serial) == 0;
log_debug("Looking for serial '%s', found '%s'...\n", opts->device_list[currentDevice].serial, udisks_drive_get_serial(drive));

if (strcmp(opts->device_list[currentDevice].vendor, "Generic") != 0)
{
Expand Down

0 comments on commit 1aca921

Please sign in to comment.