From cd23ad98b2fda411d90808f4740ced32ccbcfde6 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 5 Mar 2009 12:24:56 -0800 Subject: [PATCH] executer: Make default dir part of executer.c, not main.c. That way the vswitch can get the default without having to know it too. --- secchan/executer.c | 5 ++++- secchan/main.c | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/secchan/executer.c b/secchan/executer.c index b321f981..5f39c0f5 100644 --- a/secchan/executer.c +++ b/secchan/executer.c @@ -43,6 +43,7 @@ #include #include #include +#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; diff --git a/secchan/main.c b/secchan/main.c index d0bb73a4..43779617 100644 --- a/secchan/main.c +++ b/secchan/main.c @@ -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; -- 2.30.2