From 1f101bcb3952ce79440d0236313f3ed11cba2aaa Mon Sep 17 00:00:00 2001 From: "Leandro A. F. Pereira" Date: Sat, 30 Jun 2007 01:31:54 +0000 Subject: Cleanups, fix crashes. --- hardinfo2/arch/linux/common/pci.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'hardinfo2/arch/linux/common/pci.h') diff --git a/hardinfo2/arch/linux/common/pci.h b/hardinfo2/arch/linux/common/pci.h index e50691d0..d6a59bcb 100644 --- a/hardinfo2/arch/linux/common/pci.h +++ b/hardinfo2/arch/linux/common/pci.h @@ -24,14 +24,8 @@ __scan_pci(void) gchar *category = NULL, *name = NULL; gint n = 0; - //if (g_file_test("/usr/bin/gksudo", G_FILE_TEST_EXISTS)) { - // lspci = popen("gksudo '/bin/lspci -v'", "r"); - //} else { - lspci = popen(LSPCI, "r"); - //} - - if (!lspci) { - return; + if (!(lspci = popen(LSPCI, "r"))) { + goto pci_error; } gchar *icon; @@ -190,6 +184,7 @@ __scan_pci(void) } if (pclose(lspci)) { +pci_error: /* error (no pci, perhaps?) */ pci_list = g_strconcat(pci_list, "No PCI devices found=\n", NULL); } else if (strhash) { -- cgit v1.2.3