[systemd-devel] [PATCH 2/2] core: do not overwrite existing units source

Umut Tezduyar umut at tezduyar.com
Thu Feb 7 00:06:20 PST 2013


Hi,

It is because patch [1/2] of this patch set hasn't been committed. I have
made the same patch independent of patch [1/2] and attached to this email
thread.

Thanks


On Thu, Feb 7, 2013 at 6:12 AM, Zbigniew Jędrzejewski-Szmek <
zbyszek at in.waw.pl> wrote:

> On Mon, Feb 04, 2013 at 03:01:23PM +0100, Umut Tezduyar wrote:
> > Only set source for freshly created .mounts coming from
> > mountinfo file.
> Doesn't seem to apply anymore...
>
> Zbyszek
>
> > ---
> >  src/core/mount.c |   12 +++++++-----
> >  1 files changed, 7 insertions(+), 5 deletions(-)
> >
> > diff --git a/src/core/mount.c b/src/core/mount.c
> > index 29ce440..8231059 100644
> > --- a/src/core/mount.c
> > +++ b/src/core/mount.c
> > @@ -1440,7 +1440,7 @@ static int mount_add_one(
> >          int r;
> >          Unit *u;
> >          bool delete;
> > -        char *e, *w = NULL, *o = NULL, *s = NULL, *f = NULL;
> > +        char *e, *w = NULL, *o = NULL, *f = NULL;
> >          MountParameters *p;
> >          bool load_extras = false;
> >
> > @@ -1488,6 +1488,12 @@ static int mount_add_one(
> >                          goto fail;
> >                  }
> >
> > +                u->source_path = strdup("/proc/self/mountinfo");
> > +                if (!u->source_path) {
> > +                        r = -ENOMEM;
> > +                        goto fail;
> > +                }
> > +
> >                  r = unit_add_two_dependencies_by_name(u, UNIT_BEFORE,
> UNIT_REQUIRED_BY, SPECIAL_LOCAL_FS_TARGET, NULL, true);
> >                  if (r < 0)
> >                          goto fail;
> > @@ -1517,7 +1523,6 @@ static int mount_add_one(
> >
> >          if (!(w = strdup(what)) ||
> >              !(o = strdup(options)) ||
> > -            !(s = strdup("/proc/self/mountinfo")) ||
> >              !(f = strdup(fstype))) {
> >                  r = -ENOMEM;
> >                  goto fail;
> > @@ -1531,8 +1536,6 @@ static int mount_add_one(
> >          }
> >
> >          MOUNT(u)->from_proc_self_mountinfo = true;
> > -        free(u->source_path);
> > -        u->source_path = s;
> >
> >          free(p->what);
> >          p->what = w;
> > @@ -1558,7 +1561,6 @@ static int mount_add_one(
> >  fail:
> >          free(w);
> >          free(o);
> > -        free(s);
> >          free(f);
> >
> >          if (delete && u)
> > --
> > 1.7.2.5
> >
> > _______________________________________________
> > systemd-devel mailing list
> > systemd-devel at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/systemd-devel
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20130207/9225524d/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-core-do-not-overwrite-existing-units-source.patch
Type: application/octet-stream
Size: 1849 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20130207/9225524d/attachment-0001.obj>


More information about the systemd-devel mailing list