[PATCH weston 2/6] weston: Allow relative paths for modules

Pekka Paalanen ppaalanen at gmail.com
Fri Apr 26 02:21:45 PDT 2013


On Tue, 23 Apr 2013 17:16:48 +0200
John Kåre Alsaker <john.kare.alsaker at gmail.com> wrote:

> You should drop the code changes since they already allow relative paths.
> You just changed it to only allow base filenames.

Paths relative to what? Looks like there is a difference.

> On Tue, Apr 23, 2013 at 2:54 PM, Quentin Glidic <
> sardemff7+wayland at sardemff7.net> wrote:
> 
> > From: Quentin Glidic <sardemff7+git at sardemff7.net>
> >
> > Signed-off-by: Quentin Glidic <sardemff7+git at sardemff7.net>
> > ---
> >  man/weston.man   | 4 ++--
> >  src/compositor.c | 2 +-
> >  2 files changed, 3 insertions(+), 3 deletions(-)
> >
> > diff --git a/man/weston.man b/man/weston.man
> > index a25e619..97db3c8 100644
> > --- a/man/weston.man
> > +++ b/man/weston.man
> > @@ -102,7 +102,7 @@ Load
> >  .I backend.so
> >  instead of the default backend. The file is searched for in
> >  .IR "__weston_modules_dir__" ,
> > -or you can pass an absolute path. The default backend is
> > +or you can pass a path. The default backend is
> >  .I __weston_native_backend__
> >  unless the environment suggests otherwise, see
> >  .IR DISPLAY " and " WAYLAND_DISPLAY .
> > @@ -131,7 +131,7 @@ instead of writing them to stderr.
> >  Load the comma-separated list of modules. Only used by the test
> >  suite. The file is searched for in
> >  .IR "__weston_modules_dir__" ,
> > -or you can pass an absolute path.
> > +or you can pass a path.
> >  .TP
> >  \fB\-\^S\fR\fIname\fR, \fB\-\-socket\fR=\fIname\fR
> >  Weston will listen in the Wayland socket called
> > diff --git a/src/compositor.c b/src/compositor.c
> > index 693df2c..fe51061 100644
> > --- a/src/compositor.c
> > +++ b/src/compositor.c
> > @@ -3349,7 +3349,7 @@ load_module(const char *name, const char *entrypoint)
> >         char path[PATH_MAX];
> >         void *module, *init;
> >
> > -       if (name[0] != '/')
> > +       if (!strchr(name, '/'))
> >                 snprintf(path, sizeof path, "%s/%s", MODULEDIR, name);
> >         else
> >                 snprintf(path, sizeof path, "%s", name);

Any specific use case, like tests? I guess I should read the following
patches to find out, but that would be nice to tell in the commit
message.


Thanks,
pq


More information about the wayland-devel mailing list