From 456a3fc952d34a3e8781ca100851e6253c537109 Mon Sep 17 00:00:00 2001 From: Amaury Pouly Date: Thu, 5 Jan 2017 16:21:55 +0100 Subject: imxtools: various fixes for Windows Don't use colors since the terminal doesn't support it. Also packing is broken on MinGW so use #pragma pack when compiling for windows, this is also supported by MSCV. Change-Id: I635649d52ed5f2e0af46cb9ca2ec325955b2ddb2 --- utils/imxtools/scsitools/stmp_scsi.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'utils/imxtools/scsitools/stmp_scsi.c') diff --git a/utils/imxtools/scsitools/stmp_scsi.c b/utils/imxtools/scsitools/stmp_scsi.c index e1d0dc4c77..8daeb8a532 100644 --- a/utils/imxtools/scsitools/stmp_scsi.c +++ b/utils/imxtools/scsitools/stmp_scsi.c @@ -245,14 +245,22 @@ int stmp_get_logical_media_table(stmp_device_t dev, struct stmp_logical_media_ta int len = sizeof(header); int ret = stmp_scsi_get_logical_table(dev, 0, &header, &len); if(ret || len != sizeof(header)) + { + stmp_debugf(dev, "Device returned the wrong size for logical media header: " + "%d bytes but expected %d\n", len, sizeof(header)); return -1; + } header.count = stmp_fix_endian16be(header.count); int sz = sizeof(header) + header.count * sizeof(struct scsi_stmp_logical_table_entry_t); len = sz; *table = malloc(sz); ret = stmp_scsi_get_logical_table(dev, header.count, &(*table)->header, &len); if(ret || len != sz) + { + stmp_debugf(dev, "Device returned the wrong size for logical media table: " + "%d bytes but expected %d (%d entries)\n", len, sz, header.count); return -1; + } (*table)->header.count = stmp_fix_endian16be((*table)->header.count); for(unsigned i = 0; i < (*table)->header.count; i++) (*table)->entry[i].size = stmp_fix_endian64be((*table)->entry[i].size); -- cgit v1.2.3