From: <mga...@us...> - 2010-07-28 15:36:12
|
Revision: 1886 http://scst.svn.sourceforge.net/scst/?rev=1886&view=rev Author: mgandalf Date: 2010-07-28 15:36:06 +0000 (Wed, 28 Jul 2010) Log Message: ----------- - Set driver and handler attributes on commit as well. Modified Paths: -------------- trunk/scstadmin/scstadmin.sysfs/scstadmin Modified: trunk/scstadmin/scstadmin.sysfs/scstadmin =================================================================== --- trunk/scstadmin/scstadmin.sysfs/scstadmin 2010-07-28 14:46:41 UTC (rev 1885) +++ trunk/scstadmin/scstadmin.sysfs/scstadmin 2010-07-28 15:36:06 UTC (rev 1886) @@ -1396,11 +1396,7 @@ foreach my $handler (keys %{$handlers}) { foreach my $device (@{$$handlers{$handler}}) { - if (!defined($$config{'HANDLER'}) || - !defined($$config{'HANDLER'}->{$handler}) || - !defined($$config{'HANDLER'}->{$handler}->{'DEVICE'}) || - !defined($$config{'HANDLER'}->{$handler}->{'DEVICE'}->{$device})) { - + if (!defined($$config{'HANDLER'}->{$handler}->{'DEVICE'}->{$device})) { my $attributes = $SCST->deviceAttributes($device); next if (defined($$attributes{'scsi_device'})); @@ -1421,12 +1417,32 @@ my $devices = $$handlers{$handler}->{'DEVICE'}; foreach my $device (sort keys %{$devices}) { + my %_attributes; + foreach my $item (keys %{$$devices{$device}}) { + next if ($item eq 'CREATE_ATTRIBUTES'); + $_attributes{$item} = $$devices{$device}->{$item}; + } + + my $attributes = configToAttr(\%_attributes); + setDeviceAttributes($device, $attributes, $deletions) + if (scalar keys %{$attributes}); + next if (handlerHasDevice($handler, $device)); my $attributes = configToAttr($$devices{$device}->{'CREATE_ATTRIBUTES'}); openDevice($device, $handler, $attributes); } } + + my %_attributes; + foreach my $item (keys %{$$handlers{$handler}}) { + next if ($item eq 'DEVICE'); + $_attributes{$item} = $$handlers{$handler}->{$item}; + } + + my $attributes = configToAttr(\%_attributes); + setHandlerAttributes($handler, $attributes, $deletions) if (scalar keys %{$attributes}); + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |