diff options
Diffstat (limited to 'sys-apps/lshw/files/lshw-02.12.01b-alignment.patch')
-rw-r--r-- | sys-apps/lshw/files/lshw-02.12.01b-alignment.patch | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sys-apps/lshw/files/lshw-02.12.01b-alignment.patch b/sys-apps/lshw/files/lshw-02.12.01b-alignment.patch new file mode 100644 index 000000000000..c1dbae83810a --- /dev/null +++ b/sys-apps/lshw/files/lshw-02.12.01b-alignment.patch @@ -0,0 +1,27 @@ +fix from upstream for alignment errors + +http://ezix.org/project/changeset?new=packages/lshw/development/src/core/scsi.cc%401927&old=packages/lshw/development/src/core/scsi.cc%401923 + +--- src/core/scsi.cc ++++ src/core/scsi.cc +@@ -566,11 +566,15 @@ + if (fd >= 0) + { + int bus = -1; +- char host[50]; +- int * length = (int*)host; +- *length = sizeof(host); +- memset(host, 0, sizeof(host)); +- if (ioctl(fd, SCSI_IOCTL_PROBE_HOST, &host) >= 0) ++ union ++ { ++ char host[50]; ++ int length; ++ } tmp; ++ tmp.length = sizeof(tmp.host); ++ memset(tmp.host, 0, sizeof(tmp.host)); ++ ++ if(ioctl(fd, SCSI_IOCTL_PROBE_HOST, &tmp.length) >= 0) + { + if (ioctl(fd, SCSI_IOCTL_GET_BUS_NUMBER, &bus) >= 0) + { |