Am 04.12.2012 06:23, schrieb Peter Hutterer: > On Tue, Dec 04, 2012 at 01:06:13PM +1000, Dave Airlie wrote: >> From: Dave Airlie <[email protected]> >> >> With the missing RRProviderInit, we were adding 0 typed resources, >> which crashed when xrestop hit them, we should warn before that happens >> so future developers spot the problem. >> >> Signed-off-by: Dave Airlie <[email protected]> > > Reviewed-by: Peter Hutterer <[email protected]> > > though you should probably check for type == RT_NONE, just for correctness. > > Cheers, > Peter >
what is the expected behavier if a programm detects an unknown RESTYPE ? re, wh >> --- >> dix/resource.c | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/dix/resource.c b/dix/resource.c >> index 2aafa34..144fe23 100644 >> --- a/dix/resource.c >> +++ b/dix/resource.c >> @@ -793,6 +793,7 @@ AddResource(XID id, RESTYPE type, pointer value) >> ClientResourceRec *rrec; >> ResourcePtr res, *head; >> >> + BUG_RETURN_VAL_MSG(type == 0, FALSE, "Illegal to allocate resources >> with type 0\n"); >> #ifdef XSERVER_DTRACE >> XSERVER_RESOURCE_ALLOC(id, type, value, TypeNameString(type)); >> #endif >> -- >> 1.7.11.7 _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
