On 2008-11-04, howard parkin wrote:
> A goal I had in writing each diagnostic test was
> to try and keep all the functionality required for each
> test locally in the same file. I've lost count of the number
> of times I've had to go looking for some piece of
> functionality in some other directory that's buried in
> an include of an include etc that is somewhere
> else in the tree. Your changes are not of that nature,
> but personally I prefer how it was with the local oga_map
> function. But whatever.
Okay, I can use your code as example and create a separate mini-library
and tools. I understand you have an uncommitted version, so I'll just
cite the essential fix:
diff --git a/tools/oga1_diag/memtest.c b/tools/oga1_diag/memtest.c
index 6899f68..0aac0be 100644
--- a/tools/oga1_diag/memtest.c
+++ b/tools/oga1_diag/memtest.c
@@ -145,7 +145,7 @@ int oga_map(struct pci_dev *dev, char **reg, int *rsize,
MAP_SHARED,
mem_fd,
dev->base_addr[1]);
- if ((long)*mem < 0) {
+ if (*mem == MAP_FAILED) {
printf("mem mmap error\n");
printf("%s\n", strerror(errno));
exit(-1);
and likewise for the other .c files.
_______________________________________________
Open-graphics mailing list
[email protected]
http://lists.duskglow.com/mailman/listinfo/open-graphics
List service provided by Duskglow Consulting, LLC (www.duskglow.com)