You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compiled as user PCIMapper looks for the id files at /home/${user}/.hwinfo/pci.ids
However if the program is ran as sudo or root the getenv("HOME"); function will return /root/.hwinfo/pci.ids
Hi, Thanks for reporting this Bug!
The pci.ids file brings some more issues: HWinfo is a library that can be build shared and static. For a shared library, it is relatively easy to place the pci.ids file along the binaries. For static builds it becomes more difficult. I am currently working on a PCIMapper that does not parse the pci.ids file but builds a dictionary like structure in compile time from the file. This way, static and shared builds become much easier.
…id reading the file in runtime #60 (#81)
* Add a new header pci.ids.h with the content of scripts/pcs.ids to avoid reading the file in runtime
* Fix clang format errors
* Fix get_pci_ids function name
I found a bug using the GPU module.
When compiled as user PCIMapper looks for the id files at /home/${user}/.hwinfo/pci.ids
However if the program is ran as sudo or root the getenv("HOME"); function will return /root/.hwinfo/pci.ids
I propose this line be changed to store the pci.ids file to the same location as the applications binary.
https://github.com/lfreist/hwinfo/blob/b4adfd795aa2aa25b8dff6dd8116725f72b187dd/CMakeLists.txt#L39C67-L39C67
I'm trying to get into some open-source coding so if you would let me know your opinions I would be happy to implement them.
The text was updated successfully, but these errors were encountered: