[PATCH xserver] config: Support multiple 'Files' sections

Michał Górny mgorny at gentoo.org
Mon Mar 9 12:10:56 PDT 2015


Dnia 2015-03-09, o godz. 12:04:31
Matt Turner <mattst88 at gmail.com> napisał(a):

> On Thu, Feb 26, 2015 at 1:55 PM, Michał Górny <mgorny at gentoo.org> wrote:
> > Support reading multiple 'Files' sections in configuration,
> > concatenating the resulting paths. This makes it possible to add
> > ModulePaths and FontPaths within xorg.conf.d/ files without interfering
> > with user-provided xorg.conf. Gentoo needs this to support using
> > replacement xorg modules provided by proprietary video drivers.
> >
> > Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=88003
> > Signed-off-by: Michał Górny <mgorny at gentoo.org>
> > ---
> > [not subscribed, please CC me on replies]
> >
> >  hw/xfree86/parser/Files.c       | 8 ++++++--
> >  hw/xfree86/parser/configProcs.h | 2 +-
> >  hw/xfree86/parser/read.c        | 2 +-
> >  3 files changed, 8 insertions(+), 4 deletions(-)
> >
> > diff --git a/hw/xfree86/parser/Files.c b/hw/xfree86/parser/Files.c
> > index 849bf92..5cc3ec7 100644
> > --- a/hw/xfree86/parser/Files.c
> > +++ b/hw/xfree86/parser/Files.c
> > @@ -76,14 +76,18 @@ static xf86ConfigSymTabRec FilesTab[] = {
> >  #define CLEANUP xf86freeFiles
> >
> >  XF86ConfFilesPtr
> > -xf86parseFilesSection(void)
> > +xf86parseFilesSection(XF86ConfFilesPtr ptr)
> >  {
> >      int i, j;
> >      int k, l;
> >      char *str;
> >      int token;
> >
> > -    parsePrologue(XF86ConfFilesPtr, XF86ConfFilesRec)
> > +    if (!ptr) {
> > +        if( (ptr=calloc(1,sizeof(XF86ConfFilesRec))) == NULL ) {
> 
> Style issues:
>   - space between if and (
>   - no spaces between parentheses and the conditional expression
>   - spaces around =
>   - space after comma

That ugly part is copied from the macro used in other functions. Are
you sure you want it changed here and left ugly in the macro?

> On IRC, Keith says the patch has a memory leak, but that there are
> some existing ones in this code already. I'm not sure if he wants you
> to fix the one you're adding or not worry about it.

Does it? Well, I didn't put much effort into that since the existing
code was just dumb enough to allocate-and-replace the struct when
defined multiple times.

-- 
Best regards,
Michał Górny
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 949 bytes
Desc: OpenPGP digital signature
URL: <http://lists.x.org/archives/xorg-devel/attachments/20150309/715aae48/attachment.sig>


More information about the xorg-devel mailing list