From: Ben Pfaff Date: Thu, 5 Mar 2009 20:24:56 +0000 (-0800) Subject: executer: Make default dir part of executer.c, not main.c. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd23ad98b2fda411d90808f4740ced32ccbcfde6;p=openvswitch 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. --- 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;