mirror of
https://github.com/moibenko/mtx.git
synced 2025-12-23 05:55:13 +00:00
Refresh elements data.
If absolute_addressing == 1 refresh elements data when status command is executed. This is needed to update tape library information in the calling application.
This commit is contained in:
BIN
mtx-1.3.12.tgz
BIN
mtx-1.3.12.tgz
Binary file not shown.
@@ -929,7 +929,6 @@ void open_device(void)
|
||||
void execute_command(struct command_table_struct *command)
|
||||
{
|
||||
RequestSense_T RequestSense;
|
||||
|
||||
if (device == NULL && command->need_device)
|
||||
{
|
||||
/* try to get it from TAPE environment variable... */
|
||||
@@ -944,6 +943,11 @@ void execute_command(struct command_table_struct *command)
|
||||
}
|
||||
open_device();
|
||||
}
|
||||
if (command->need_status && absolute_addressing)
|
||||
{
|
||||
FreeElementData(ElementStatus);
|
||||
ElementStatus = NULL;
|
||||
}
|
||||
if (!ElementStatus && command->need_status)
|
||||
{
|
||||
inquiry_info = RequestInquiry(MediumChangerFD,&RequestSense);
|
||||
|
||||
@@ -523,8 +523,12 @@ ElementModeSense_T *ReadAssignmentPage(DEVICE_TYPE MediumChangerFD)
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void FreeElementData(ElementStatus_T *data)
|
||||
void FreeElementData(ElementStatus_T *data)
|
||||
{
|
||||
if (!data)
|
||||
{
|
||||
return;
|
||||
}
|
||||
free(data->DataTransferElementAddress);
|
||||
free(data->DataTransferElementSourceStorageElementNumber);
|
||||
free(data->DataTransferElementPhysicalLocation);
|
||||
|
||||
@@ -60,6 +60,7 @@ ElementStatus_T *ReadElementStatus( DEVICE_TYPE MediumChangerFD,
|
||||
RequestSense_T *RequestSense,
|
||||
Inquiry_T *inquiry_info,
|
||||
SCSI_Flags_T *flags);
|
||||
void FreeElementData(ElementStatus_T *data);
|
||||
|
||||
Inquiry_T *RequestInquiry( DEVICE_TYPE fd,
|
||||
RequestSense_T *RequestSense);
|
||||
|
||||
Reference in New Issue
Block a user