mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-24 22:21:27 +00:00
scstadmin: Fix -close_dev
Avoid that closing a device fails and an empty export list is reported if a device is currently not exported. This patch is based on a patch provided by Dzmitry Kotsikau <dkotsikau@gmail.com>. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7310 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -4751,7 +4751,8 @@ sub closeDevice {
|
||||
my ($attributes, $errorString) = $SCST->deviceAttributes($device);
|
||||
|
||||
if (!$force) {
|
||||
if (keys %{$$attributes{'exported'}}) {
|
||||
if (keys %{$$attributes{'exported'}} &&
|
||||
$$attributes{'exported'}->{'value'}) {
|
||||
listExported($device, $attributes);
|
||||
immediateExit("Device '$device' still in use, aborting. ".
|
||||
"Use -force to override.");
|
||||
|
||||
Reference in New Issue
Block a user