1 |
vapier 08/04/20 08:42:55 |
2 |
|
3 |
Added: lshw-02.12.01b-alignment.patch |
4 |
Log: |
5 |
Fix from upstream for alignment troubles on sparc #217783 by Friedrich Oslage. |
6 |
(Portage version: 2.2_pre5) |
7 |
|
8 |
Revision Changes Path |
9 |
1.1 sys-apps/lshw/files/lshw-02.12.01b-alignment.patch |
10 |
|
11 |
file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/lshw/files/lshw-02.12.01b-alignment.patch?rev=1.1&view=markup |
12 |
plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sys-apps/lshw/files/lshw-02.12.01b-alignment.patch?rev=1.1&content-type=text/plain |
13 |
|
14 |
Index: lshw-02.12.01b-alignment.patch |
15 |
=================================================================== |
16 |
fix from upstream for alignment errors |
17 |
|
18 |
http://ezix.org/project/changeset?new=packages/lshw/development/src/core/scsi.cc%401927&old=packages/lshw/development/src/core/scsi.cc%401923 |
19 |
|
20 |
--- src/core/scsi.cc |
21 |
+++ src/core/scsi.cc |
22 |
@@ -566,11 +566,15 @@ |
23 |
if (fd >= 0) |
24 |
{ |
25 |
int bus = -1; |
26 |
- char host[50]; |
27 |
- int * length = (int*)host; |
28 |
- *length = sizeof(host); |
29 |
- memset(host, 0, sizeof(host)); |
30 |
- if (ioctl(fd, SCSI_IOCTL_PROBE_HOST, &host) >= 0) |
31 |
+ union |
32 |
+ { |
33 |
+ char host[50]; |
34 |
+ int length; |
35 |
+ } tmp; |
36 |
+ tmp.length = sizeof(tmp.host); |
37 |
+ memset(tmp.host, 0, sizeof(tmp.host)); |
38 |
+ |
39 |
+ if(ioctl(fd, SCSI_IOCTL_PROBE_HOST, &tmp.length) >= 0) |
40 |
{ |
41 |
if (ioctl(fd, SCSI_IOCTL_GET_BUS_NUMBER, &bus) >= 0) |
42 |
{ |
43 |
|
44 |
|
45 |
|
46 |
-- |
47 |
gentoo-commits@l.g.o mailing list |