executer: Make default dir part of executer.c, not main.c.
authorBen Pfaff <blp@nicira.com>
Thu, 5 Mar 2009 20:24:56 +0000 (12:24 -0800)
committerBen Pfaff <blp@nicira.com>
Thu, 5 Mar 2009 20:24:56 +0000 (12:24 -0800)
That way the vswitch can get the default without having to know it too.

secchan/executer.c
secchan/main.c

index b321f9812881fd6bef21f488d3653863a989f5b4..5f39c0f50faa192898f1dc3881ea6773dfeda2f9 100644 (file)
@@ -43,6 +43,7 @@
 #include <sys/wait.h>
 #include <string.h>
 #include <unistd.h>
+#include "dirs.h"
 #include "dynamic-string.h"
 #include "fatal-signal.h"
 #include "openflow/nicira-ext.h"
@@ -496,7 +497,9 @@ executer_create(const char *command_acl, const char *command_dir,
 
     e = xcalloc(1, sizeof *e);
     e->command_acl = xstrdup(command_acl);
-    e->command_dir = xstrdup(command_dir);
+    e->command_dir = (command_dir
+                      ? xstrdup(command_dir)
+                      : xasprintf("%s/commands", ofp_pkgdatadir));
     e->n_children = 0;
     *executerp = e;
     return 0;
index d0bb73a468018e6976ad6c56d9e2eacbad23579d..437796171c813f6aa7f7b883a8fd7a23df69764b 100644 (file)
@@ -315,7 +315,7 @@ parse_options(int argc, char *argv[], struct ofsettings *s)
     s->enable_stp = false;
     s->in_band = true;
     s->command_acl = "";
-    s->command_dir = xasprintf("%s/commands", ofp_pkgdatadir);
+    s->command_dir = NULL;
     for (;;) {
         int error;
         int c;