Skip to content

Instantly share code, notes, and snippets.

@cxreg
Created January 15, 2013 21:04
Show Gist options
  • Save cxreg/4542058 to your computer and use it in GitHub Desktop.
Save cxreg/4542058 to your computer and use it in GitHub Desktop.
make -base satisfy "You must specify all or none of -conf, -log, and -db"
diff --git a/src/switch.c b/src/switch.c
index f86b080..71abcd8 100644
--- a/src/switch.c
+++ b/src/switch.c
@@ -415,7 +415,7 @@ int main(int argc, char *argv[])
char *local_argv[1024] = { 0 };
int local_argc = argc;
char *arg_argv[128] = { 0 };
- int alt_dirs = 0, log_set = 0, run_set = 0, do_kill = 0;
+ int alt_dirs = 0, alt_base = 0, log_set = 0, run_set = 0, do_kill = 0;
int priority = 0;
#ifdef __sun
switch_core_flag_t flags = SCF_USE_SQL;
@@ -780,6 +780,7 @@ int main(int argc, char *argv[])
return 255;
}
strcpy(SWITCH_GLOBAL_dirs.base_dir, local_argv[x]);
+ alt_base = 1;
}
else if (!strcmp(local_argv[x], "-temp")) {
@@ -883,7 +884,7 @@ int main(int argc, char *argv[])
return 255;
}
- if (alt_dirs && alt_dirs != 3) {
+ if (alt_dirs && alt_dirs != 3 && !alt_base) {
fprintf(stderr, "You must specify all or none of -conf, -log, and -db\n");
return 255;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment