fix some issues for SCSI command

This commit is contained in:
Lei Xue
2017-06-24 12:09:05 +08:00
parent 59bebf79be
commit a523a583dc
5 changed files with 77 additions and 35 deletions

View File

@@ -149,8 +149,8 @@ func BuildSenseData(cmd *api.SCSICommand, key byte, asc SCSISubError) {
for i := 0; i < 4; i++ {
senseBuffer.WriteByte(0x00)
}
senseBuffer.WriteByte((byte(asc) >> 8) & 0xff)
senseBuffer.WriteByte(byte(asc) & 0xff)
senseBuffer.WriteByte(byte((uint16(asc) >> 8) & 0xff))
senseBuffer.WriteByte(byte(asc & 0x00ff))
for i := 0; i < 4; i++ {
senseBuffer.WriteByte(0x00)
}