diff options
-rw-r--r-- | vbe.c | 27 |
1 files changed, 15 insertions, 12 deletions
@@ -284,22 +284,25 @@ int get_edid__old(char *edid) int get_edid(char *edid) { int pci_config_type = 1; /* Determine PCI configuration type */ - int ok; + int ok = 0; + + if (getuid() != 0) { + fprintf(stderr, "you must be root to run this program\n"); + return 0; + } - /* Initialize Int10 */ - ok = box_is_xbox() || InitInt10(pci_config_type) == 0; - - if (ok) { - ok = - (box_is_xbox() || vbe_check_vbe_info()) && - vbe_get_edid_info(edid); + if (!box_is_xbox()) { + if (InitInt10(pci_config_type) == 0) { + ok = vbe_check_vbe_info() + && vbe_get_edid_info(edid); + FreeInt10(); + } + } #ifdef LRMI - if (!ok) ok = get_edid__old(edid); + if (!ok) + ok = get_edid__old(edid); #endif - FreeInt10(); - } else if (getuid() != 0) - fprintf(stderr, "you must be root to run this program\n"); return ok ? 128 : 0; } |