[PATCH 1/4] Fix a couple of compiler warnings
Dan Nicholson
dbn.lists at gmail.com
Wed May 12 10:53:18 PDT 2010
On Sat, May 08, 2010 at 10:51:57PM +0200, Julien Cristau wrote:
> On Sat, May 8, 2010 at 09:06:26 -0700, Dan Nicholson wrote:
>
> > > Can we make the stuff in InputAttributes const instead?
> >
> > No, because the strings from hal are not const. I have a patch to make
> > config/udev dup the strings because:
> >
> > 1. udevd might die
> > 2. the device might get immediately removed
> >
> > In either case, you're holding a pointer into udev's database that
> > might go away at any time. Doesn't seem like a situation we'd want to
> > be in.
> >
> I'm holding a pointer to a string that libudev gave me, and that's
> hanging off an udev_device that I'm holding a reference on, until after
> NIDR returns. I'm not sure how that string could go away?
Yeah, clearly libudev has it's own copies of the strings that it will
keep until we unref the udev_device. So, here's a patch that makes the
InputAttributes members const. Like Keith, I couldn't figure out how to
handle char **tags without an explicit cast.
Dan
More information about the xorg-devel
mailing list