ovs-ofctl: Fixed PID file naming on windows
authorPaul Boca <pboca@cloudbasesolutions.com>
Wed, 8 Jun 2016 08:40:34 +0000 (08:40 +0000)
committerBen Pfaff <blp@ovn.org>
Tue, 14 Jun 2016 17:05:21 +0000 (10:05 -0700)
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>
Acked-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
lib/daemon-windows.c

index ac71aa1..8cf0fea 100644 (file)
@@ -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);
     }