updated to 3.1.8

This commit is contained in:
Michal Hlavinka 2011-10-03 12:30:27 +02:00
parent 93070680f3
commit ab4c3ec5e9
6 changed files with 11 additions and 149 deletions

1
.gitignore vendored
View File

@ -1,2 +1,3 @@
pciutils-3.1.6.tar.gz
/pciutils-3.1.7.tar.gz
/pciutils-3.1.8.tar.gz

View File

@ -1,13 +0,0 @@
diff -up pciutils-3.0.0/lib/access.c.scan pciutils-3.0.0/lib/access.c
--- pciutils-3.0.0/lib/access.c.scan 2008-04-10 21:15:47.000000000 +0200
+++ pciutils-3.0.0/lib/access.c 2008-09-01 15:15:27.000000000 +0200
@@ -16,7 +16,8 @@
void
pci_scan_bus(struct pci_access *a)
{
- a->methods->scan(a);
+ if (a->methods)
+ a->methods->scan(a);
}
struct pci_dev *

View File

@ -1,59 +0,0 @@
diff -up pciutils-3.0.0/lib/names.c.buf pciutils-3.0.0/lib/names.c
--- pciutils-3.0.0/lib/names.c.buf 2008-04-10 21:15:47.000000000 +0200
+++ pciutils-3.0.0/lib/names.c 2008-09-01 15:14:58.000000000 +0200
@@ -65,12 +65,27 @@ format_name(char *buf, int size, int fla
res = snprintf(buf, size, "%s", num);
else if (!name)
res = snprintf(buf, size, ((flags & PCI_LOOKUP_MIXED) ? "%s [%s]" : "%s %s"), unknown, num);
- else if (!(flags & PCI_LOOKUP_MIXED))
+ else if (!(flags & PCI_LOOKUP_MIXED))
res = snprintf(buf, size, "%s", name);
else
res = snprintf(buf, size, "%s [%s]", name, num);
- if (res < 0 || res >= size)
+ if (res < 0 || res >= size) {
+ if (name && res >= size) {
+ int nlen = strlen(name);
+ if (nlen > (res - size) + 5) {
+ char *nname = strdup(name);
+ int off = nlen - (res - size) - 5;
+ if (nname) {
+ nname[off] = '.';
+ nname[off+1] = '.';
+ nname[off+2] = '.';
+ nname[off+3] = 0;
+ return format_name(buf, size, flags, nname, num, unknown);
+ }
+ }
+ }
return "<pci_lookup_name: buffer too small>";
+ }
else
return buf;
}
@@ -101,8 +116,24 @@ format_name_pair(char *buf, int size, in
else /* v && !d */
res = snprintf(buf, size, "%s Device %s", v, num+5);
}
- if (res < 0 || res >= size)
+ if (res < 0 || res >= size) {
+ if (d && res >= size) {
+ int nlen = strlen(d);
+ if (nlen > (res - size) + 5) {
+ char *nname = strdup(d);
+ int off = nlen - (res - size) - 5;
+ if (nname) {
+ nname[off] = '.';
+ nname[off+1] = '.';
+ nname[off+2] = '.';
+ nname[off+3] = 0;
+ return format_name_pair(buf, size, flags, v, nname, num);
+ }
+ }
+ }
+
return "<pci_lookup_name: buffer too small>";
+ }
else
return buf;
}

View File

@ -1,58 +0,0 @@
diff -up pciutils-3.0.0/lib/pread.h.pread pciutils-3.0.0/lib/pread.h
--- pciutils-3.0.0/lib/pread.h.pread 2006-05-05 14:18:24.000000000 +0200
+++ pciutils-3.0.0/lib/pread.h 2008-09-01 15:15:53.000000000 +0200
@@ -12,54 +12,6 @@
* don't define it.
*/
-#if defined(__GLIBC__) && __GLIBC__ == 2 && __GLIBC_MINOR__ > 0
-/* glibc 2.1 or newer -> pread/pwrite supported automatically */
-
-#elif defined(i386) && defined(__GLIBC__)
-/* glibc 2.0 on i386 -> call syscalls directly */
-#include <asm/unistd.h>
-#include <syscall-list.h>
-#ifndef SYS_pread
-#define SYS_pread 180
-#endif
-static int pread(unsigned int fd, void *buf, size_t size, loff_t where)
-{ return syscall(SYS_pread, fd, buf, size, where); }
-#ifndef SYS_pwrite
-#define SYS_pwrite 181
-#endif
-static int pwrite(unsigned int fd, void *buf, size_t size, loff_t where)
-{ return syscall(SYS_pwrite, fd, buf, size, where); }
-
-#elif defined(i386)
-/* old libc on i386 -> call syscalls directly the old way */
-#include <asm/unistd.h>
-static _syscall5(int, pread, unsigned int, fd, void *, buf, size_t, size, u32, where_lo, u32, where_hi);
-static _syscall5(int, pwrite, unsigned int, fd, void *, buf, size_t, size, u32, where_lo, u32, where_hi);
-static int do_read(struct pci_dev *d UNUSED, int fd, void *buf, size_t size, int where) { return pread(fd, buf, size, where, 0); }
-static int do_write(struct pci_dev *d UNUSED, int fd, void *buf, size_t size, int where) { return pwrite(fd, buf, size, where, 0); }
-#define PCI_HAVE_DO_READ
-
-#else
-/* In all other cases we use lseek/read/write instead to be safe */
-#define make_rw_glue(op) \
- static int do_##op(struct pci_dev *d, int fd, void *buf, size_t size, int where) \
- { \
- struct pci_access *a = d->access; \
- int r; \
- if (a->fd_pos != where && lseek(fd, where, SEEK_SET) < 0) \
- return -1; \
- r = op(fd, buf, size); \
- if (r < 0) \
- a->fd_pos = -1; \
- else \
- a->fd_pos = where + r; \
- return r; \
- }
-make_rw_glue(read)
-make_rw_glue(write)
-#define PCI_HAVE_DO_READ
-#endif
-
#ifndef PCI_HAVE_DO_READ
#define do_read(d,f,b,l,p) pread(f,b,l,p)
#define do_write(d,f,b,l,p) pwrite(f,b,l,p)

View File

@ -1,23 +1,14 @@
Name: pciutils
Version: 3.1.7
Release: 6%{?dist}
Version: 3.1.8
Release: 1%{?dist}
Source: ftp://atrey.karlin.mff.cuni.cz/pub/linux/pci/%{name}-%{version}.tar.gz
Source1: multilibconfigh
#truncate too long names (#205948)
Patch1: pciutils-2.2.4-buf.patch
#don't segfault on systems without PCI bus (#84146)
Patch2: pciutils-2.1.10-scan.patch
#use pread/pwrite, ifdef check is obsolete nowadays
Patch3: pciutils-havepread.patch
#change pci.ids directory to hwdata, fedora/rhel specific
Patch6: pciutils-2.2.1-idpath.patch
Patch1: pciutils-2.2.1-idpath.patch
#add support for directory with another pci.ids, rejected by upstream, rhbz#195327
Patch9: pciutils-dir-d.patch
Patch2: pciutils-dir-d.patch
License: GPLv2+
URL: http://atrey.karlin.mff.cuni.cz/~mj/pciutils.shtml
@ -62,11 +53,8 @@ devices connected to the PCI bus.
%prep
%setup -q -n pciutils-%{version}
%patch1 -p1 -b .buf
%patch2 -p1 -b .scan
%patch3 -p1 -b .pread
%patch6 -p1 -b .idpath
%patch9 -p1 -b .dird
%patch1 -p1 -b .idpath
%patch2 -p1 -b .dird
sed -i -e 's|^SRC=.*|SRC="http://pciids.sourceforge.net/pci.ids"|' update-pciids.sh
@ -134,6 +122,9 @@ install -p lib/libpci.pc $RPM_BUILD_ROOT%{_libdir}/pkgconfig
rm -rf $RPM_BUILD_ROOT
%changelog
* Mon Oct 03 2011 Michal Hlavinka <mhlavink@redhat.com> - 3.1.8-1
- updated to 3.1.8
* Thu Mar 17 2011 Michal Hlavinka <mhlavink@redhat.com> - 3.1.7-6
- don't forget to close pci.ids directory

View File

@ -1 +1 @@
f3e349d22a3714b4272b171649ad5235 pciutils-3.1.7.tar.gz
79312f138311d29291c7d44d624cd37e pciutils-3.1.8.tar.gz