Message ID | 1465375215-8920-1-git-send-email-pboca@cloudbasesolutions.com |
---|---|
State | Accepted |
Headers | show |
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com> > -----Mesaj original----- > De la: dev [mailto:dev-bounces@openvswitch.org] În numele Paul Boca > Trimis: Wednesday, June 8, 2016 11:41 AM > Către: dev@openvswitch.org > Subiect: [ovs-dev] [PATCH V4 2/4] ovs-ofctl: Fixed PID file naming on > windows > > On Windows if a relative file name is given to --pidfile parameter (not > containing ':') then the application name is used for PID file, ignoring the > given name. > > Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com> > --- > V2: Updated commit message > V3: Updated commit message > V4: Updated commit message > --- > lib/daemon-windows.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/lib/daemon-windows.c b/lib/daemon-windows.c index > ac71aa1..8cf0fea 100644 > --- a/lib/daemon-windows.c > +++ b/lib/daemon-windows.c > @@ -485,8 +485,12 @@ daemon_become_new_user(bool access_datapath > OVS_UNUSED) char * make_pidfile_name(const char *name) { > - if (name && strchr(name, ':')) { > - return xstrdup(name); > + if (name) { > + if (strchr(name, ':')) { > + return xstrdup(name); > + } else { > + return xasprintf("%s/%s", ovs_rundir(), name); > + } > } else { > return xasprintf("%s/%s.pid", ovs_rundir(), program_name); > } > -- > 2.7.2.windows.1 > _______________________________________________ > dev mailing list > dev@openvswitch.org > http://openvswitch.org/mailman/listinfo/dev
On Wed, Jun 08, 2016 at 08:40:34AM +0000, Paul Boca wrote: > On Windows if a relative file name is given to --pidfile parameter > (not containing ':') then the application name is used for PID file, > ignoring the given name. > > Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com> > --- > V2: Updated commit message > V3: Updated commit message > V4: Updated commit message Applied, thanks!
diff --git a/lib/daemon-windows.c b/lib/daemon-windows.c index ac71aa1..8cf0fea 100644 --- a/lib/daemon-windows.c +++ b/lib/daemon-windows.c @@ -485,8 +485,12 @@ daemon_become_new_user(bool access_datapath OVS_UNUSED) char * make_pidfile_name(const char *name) { - if (name && strchr(name, ':')) { - return xstrdup(name); + if (name) { + if (strchr(name, ':')) { + return xstrdup(name); + } else { + return xasprintf("%s/%s", ovs_rundir(), name); + } } else { return xasprintf("%s/%s.pid", ovs_rundir(), program_name); }
On Windows if a relative file name is given to --pidfile parameter (not containing ':') then the application name is used for PID file, ignoring the given name. Signed-off-by: Paul-Daniel Boca <pboca@cloudbasesolutions.com> --- V2: Updated commit message V3: Updated commit message V4: Updated commit message --- lib/daemon-windows.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)