summaryrefslogtreecommitdiff
path: root/src/common_device_name.c
AgeCommit message (Collapse)Author
2016-05-02device-name: handle calloc failure in insert()arsharma
Issue was spotted by Klocwork, and fixed by arsharma as part of Android-ia. Just bail out if memory allocation fails. All the callers of insert() already handle the case. [Emil Velikov: Split from larger patch, write commit message] Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
2013-06-24pci_id_file_open: move variable inside the #ifndef that uses itAlan Coopersmith
Clears up gcc warning on Solaris: common_device_name.c: In function 'pci_id_file_open': common_device_name.c:83:17: warning: unused variable 'result' [-Wunused-variable] Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-06-07Protect config.h like usual.Thomas Klausner
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2012-02-27Use O_CLOEXEC for internal file descriptorsAdam Jackson
Well, almost all of them. zlib doesn't support "e" in the mode string in gzopen() though it will silently accept and ignore it, and Solaris appears not to support "e" in the mode string at all. Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-02-24Use correct type for pci_id file accessor functionsMathias Krause
This fixes the compiler warning of using the wrong type for gzgets() and gzclose() as they want a gzFile argument, not a pointer to gzFile. The abstraction layer pci_id_file should just abstract the full type. Signed-off-by: Mathias Krause <mathias.krause@secunet.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2012-02-08Close pci.ids file when bailing out because realloc failedAlan Coopersmith
Error: File Leak Leaked File f at line 272 of src/common_device_name.c in function 'populate_vendor'. f initialized at line 204 with fopen("/usr/share/hwdata/pci.ids", "r"). [ This bug was found by the Parfait 0.5.0 bug checking tool. For more information see http://labs.oracle.com/projects/parfait/ ] Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2011-09-16Strip trailing whitespaceAlan Coopersmith
Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}' git diff -w & git diff -b show no diffs from this change Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2009-08-09Silence compiler warning about pci_id_file_open definitionJulien Cristau
src/common_device_name.c:59: warning: function declaration isn't a prototype src/common_device_name.c: In function 'pci_id_file_open': src/common_device_name.c:59: warning: old-style function definition
2008-11-19Don't open/gzopen pci.ids if we're not going to read itAlan Coopersmith
2008-07-08Handle compressed pci.idsKel Modderman
Add an option to build with zlib support so we can find vendor/device information if the pci.ids file is gzipped. Signed-off-by: Julien Cristau <jcristau@debian.org>
2008-03-06Bug #14818: Actually return the PCI vendor name, instead of NULL.Doug Chapman
2008-02-27Don't export private symbols.Julien Cristau
2007-01-12Remove extra fallback definition of PCIIDS_PATH.Eric Anholt
PCIIDS_PATH should always be provided by configure.ac and config.h.
2006-08-10Fix a segfault in populate_vendor that was triggered when the pci.ids fileIan Romanick
could not be opened. Thanks to Aaron Plattner for reporting this. Fix a couple possible memory leaks in the same function.
2006-07-30Added some function preamble comments.Ian Romanick
2006-03-27Remove src/pcils.c and src/Makefile.foo. Add src/scanpci.c.XORG-7_0_99_901Ian Romanick
Bump version to 0.3.0. Replace pci_get_name with pci_get_strings. This function matches the functionality provided by the Xorg scanpci module almost identically.
2006-03-18Initial import of libpciaccess.Ian Romanick