Changes of Revision 5
[-] | Changed | lshw.spec |
x 1
2 %define disable_gui 0 3 -%define _default_patch_fuzz 3 4 %if 0%{?sles_version} 5 %if 0%{?sles_version} == 9 || 0%{?sles_version} == 10 6 %define disable_gui 1 7
8 Release: 1 9 Source: %{name}-%{version}.tar.bz2 10 Patch0: lshw-malloc.diff 11 -Patch1: lshw-scsi-scan.patch 12 URL: http://ezix.org/project/wiki/HardwareLiSter 13 License: GPL 14 Group: Applications/System 15
16 %prep 17 %setup 18 %patch0 19 -%patch1 -p4 -R 20 21 %build 22 %if 0%{?suse_version} 23 |
||
[+] | Deleted | lshw-scsi-scan.patch ^ |
@@ -1,100 +0,0 @@ -Index: packages/lshw/development/src/core/scsi.cc -=================================================================== ---- a/packages/lshw/development/src/core/scsi.cc -+++ b/packages/lshw/development/src/core/scsi.cc -@@ -30,5 +30,5 @@ - __ID("@(#) $Id$"); - --#define SG_X "/dev/sg%d" -+#define SG_X "/dev/sg*" - #define SG_MAJOR 21 - -@@ -654,8 +654,7 @@ - - --static bool scan_sg(int sg, --hwNode & n) --{ -- char buffer[20]; -+static void scan_sg(hwNode & n) -+{ -+ int sg; - int fd = -1; - My_sg_scsi_id m_id; -@@ -666,14 +665,22 @@ - int emulated = 0; - bool ghostdeventry = false; -- -- snprintf(buffer, sizeof(buffer), SG_X, sg); -- -- ghostdeventry = !exists(buffer); -- -- if(ghostdeventry) mknod(buffer, (S_IFCHR | S_IREAD), MKDEV(SG_MAJOR, sg)); -- fd = open(buffer, OPEN_FLAG | O_NONBLOCK); -- if(ghostdeventry) unlink(buffer); -+ size_t j; -+ glob_t entries; -+ -+ if(glob(SG_X, 0, NULL, &entries) == 0) -+ { -+ for(j=0; j < entries.gl_pathc; j++) -+ { -+ sg = strtol(strpbrk(entries.gl_pathv[j], "0123456789"), NULL, 10); -+ -+ ghostdeventry = !exists(entries.gl_pathv[j]); -+ -+ if(ghostdeventry) -+ mknod(entries.gl_pathv[j], (S_IFCHR | S_IREAD), MKDEV(SG_MAJOR, sg)); -+ fd = open(entries.gl_pathv[j], OPEN_FLAG | O_NONBLOCK); -+ if(ghostdeventry) -+ unlink(entries.gl_pathv[j]); - if (fd < 0) -- return false; -+ continue; - - memset(&m_id, 0, sizeof(m_id)); -@@ -681,5 +688,5 @@ - { - close(fd); -- return true; // we failed to get info but still hope we can continue -+ continue; // we failed to get info but still hope we can continue - } - -@@ -774,9 +781,6 @@ - parent = n.addChild(hwNode("scsi", hw::storage)); - -- if (!parent) -- { -- close(fd); -- return true; -- } -+ if (parent) -+ { - - if(parent->getBusInfo() == "") -@@ -790,8 +794,10 @@ - } - parent->addChild(device); -+ } - - close(fd); -- -- return true; -+ } -+ globfree(&entries); -+ } - } - -@@ -890,10 +896,7 @@ - bool scan_scsi(hwNode & n) - { -- int i = 0; -- - scan_devices(); - -- while (scan_sg(i, n)) -- i++; -+ scan_sg(n); - - scan_hosts(n); - |