[PATCH radeontool 1/5] Clearer error message on fatal errors

Tormod Volden lists.tormod at gmail.com
Fri Dec 2 13:32:02 PST 2011


From: Tormod Volden <debian.tormod at gmail.com>

Let the user know that we actually hit an error.
This fixes gcc format-security warnings as well.

Also add a missing newline in one error message.

Signed-off-by: Tormod Volden <debian.tormod at gmail.com>
---
 avivotool.c  |    2 +-
 radeonreg.c  |    2 +-
 radeontool.c |    4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/avivotool.c b/avivotool.c
index 240f523..c555083 100644
--- a/avivotool.c
+++ b/avivotool.c
@@ -64,7 +64,7 @@ unsigned char * volatile fb_mem;
 
 static void fatal(char *why)
 {
-    fprintf(stderr, why);
+    fprintf(stderr, "Error: %s", why);
     pci_system_cleanup();
 
 }
diff --git a/radeonreg.c b/radeonreg.c
index 9948665..68dfad3 100644
--- a/radeonreg.c
+++ b/radeonreg.c
@@ -47,7 +47,7 @@ unsigned char * volatile fb_mem;
 
 static void fatal(char *why)
 {
-    fprintf(stderr, why);
+    fprintf(stderr, "Error: %s", why);
     pci_system_cleanup();
 
 }
diff --git a/radeontool.c b/radeontool.c
index 6e269f1..de742d1 100644
--- a/radeontool.c
+++ b/radeontool.c
@@ -39,7 +39,7 @@ unsigned char * volatile ctrl_mem;
 static void radeon_rom_legacy_mmio_table(unsigned char *bios, int offset);
 static void fatal(char *why)
 {
-    fprintf(stderr,why);
+    fprintf(stderr, "Error: %s", why);
     pci_system_cleanup();
     exit(-1);
 }
@@ -2879,7 +2879,7 @@ void radeon_rom_tables(const char * file)
 	close(fd);
 
 	if (bios[0] != 0x55 || bios[1] != 0xaa)
-		fatal("PCI ROM signature 0x55 0xaa missing");
+		fatal("PCI ROM signature 0x55 0xaa missing\n");
 	hdr = BIOS16(0x48);
 	printf("\nBIOS Tables:\n------------\n\n");	
 	printf("Header at %x, type: %d [%s]\n", hdr, BIOS8(hdr),
-- 
1.7.5.4



More information about the xorg-driver-ati mailing list