Bottom: d4ad38b0621522078c4a0701602ea4b83a80e903
-Top: e51eb499bbd274dcb85a7a69e7837890cd9a0e16
+Top: 09bc4f43699418809ec483f853154e9581482fc0
Author: Sean Hefty <sean.hefty@intel.com>
Date: 2010-07-23 17:12:24 -0700
diff --git a/src/acme.c b/src/acme.c
old mode 100644
new mode 100755
-index d9d9871..8a64b7f
+index d9d9871..283002b
--- a/src/acme.c
+++ b/src/acme.c
-@@ -39,6 +39,8 @@
+@@ -1,5 +1,5 @@
+ /*
+- * Copyright (c) 2009 Intel Corporation. All rights reserved.
++ * Copyright (c) 2009-2010 Intel Corporation. All rights reserved.
+ *
+ * This software is available to you under the OpenIB.org BSD license
+ * below:
+@@ -39,6 +39,9 @@
#include <infiniband/acm.h>
#include "libacm.h"
-+static char opts_file[100] = "/etc/ibacm/acm_opts.cfg";
-+static char addr_file[100] = "/etc/ibacm/acm_addr.cfg";
++static char dest_dir = "/etc/ibacm";
++static char opts_file = "acm_opts.cfg";
++static char addr_file = "acm_addr.cfg";
static char *dest_addr;
static char *src_addr;
static char addr_type = 'i';
-@@ -62,6 +64,8 @@ static void show_usage(char *program)
+@@ -60,8 +63,12 @@ static void show_usage(char *program)
+ printf(" -d dest_addr - format defined by -f option\n");
+ printf(" [-v] - verify ACM response against SA query response\n");
printf("usage 2: %s\n", program);
- printf(" -A - generate local acm_addr.cfg configuration file\n");
- printf(" -O - generate local acm_opts.cfg options file\n");
-+ printf(" -D - specify destination directory for output files\n");
+- printf(" -A - generate local acm_addr.cfg configuration file\n");
+- printf(" -O - generate local acm_opts.cfg options file\n");
++ printf(" -A [addr_file] - generate local address configuration file\n");
++ printf(" (default is acm_addr.cfg)\n");
++ printf(" -O [opt_file] - generate local acm_opts.cfg options file\n");
++ printf(" (default is acm_opts.cfg)\n");
++ printf(" -D dest_dir - specify destination directory for output files\n");
+ printf(" (default is /etc/ibacm)\n");
}
static void gen_opts_temp(FILE *f)
-@@ -191,7 +195,7 @@ static int gen_opts(void)
+@@ -191,8 +198,9 @@ static int gen_opts(void)
FILE *f;
printf("Generating acm_opts.cfg\n");
- if (!(f = fopen("acm_opts.cfg", "w"))) {
+- printf("Failed to open option configuration file\n");
++ mkdir(dest_dir, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
+ if (!(f = fopen(opts_file, "w"))) {
- printf("Failed to open option configuration file\n");
++ printf("Failed to open option configuration file: %s\n", strerror(errno));
return -1;
}
-@@ -326,7 +330,7 @@ static int gen_addr(void)
+
+@@ -326,8 +334,9 @@ static int gen_addr(void)
int ret;
printf("Generating acm_addr.cfg\n");
- if (!(f = fopen("acm_addr.cfg", "w"))) {
+- printf("Failed to open address configuration file\n");
++ mkdir(dest_dir, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
+ if (!(f = fopen(addr_file, "w"))) {
- printf("Failed to open address configuration file\n");
++ printf("Failed to open address configuration file: %s\n", strerror(errno));
return -1;
}
-@@ -501,7 +505,7 @@ int CDECL_FUNC main(int argc, char **argv)
+
+@@ -501,7 +510,7 @@ int CDECL_FUNC main(int argc, char **argv)
if (ret)
goto out;
- while ((op = getopt(argc, argv, "f:s:d:vAO")) != -1) {
-+ while ((op = getopt(argc, argv, "f:s:d:vAOD:")) != -1) {
++ while ((op = getopt(argc, argv, "f:s:d:vA::O::D:")) != -1) {
switch (op) {
case 'f':
addr_type = optarg[0];
-@@ -521,6 +525,10 @@ int CDECL_FUNC main(int argc, char **argv)
+@@ -517,9 +526,19 @@ int CDECL_FUNC main(int argc, char **argv)
+ break;
+ case 'A':
+ make_addr = 1;
++ if (optarg)
++ addr_file = optarg;
++printf("set addr file to %s\n", addr_file);
+ break;
case 'O':
make_opts = 1;
- break;
-+ case 'D':
-+ snprintf(opts_file, 80, "%s/acm_opts.cfg", optarg);
-+ snprintf(addr_file, 80, "%s/acm_addr.cfg", optarg);
++ if (optarg)
++ opt_file = optarg;
++printf("set opt file to %s\n", addr_file);
+ break;
++ case 'D':
++ dest_dir = optarg;
++printf("set dest dir to %s\n", dest_dir);
+ break;
default:
show_usage(argv[0]);
- exit(1);
+++ /dev/null
-Bottom: e51eb499bbd274dcb85a7a69e7837890cd9a0e16
-Top: 09bc4f43699418809ec483f853154e9581482fc0
-Author: Sean Hefty <sean.hefty@intel.com>
-Date: 2010-07-28 12:26:49 -0700
-
-Refresh of cfg
-
----
-
-diff --git a/src/acme.c b/src/acme.c
-index 8a64b7f..283002b 100755
---- a/src/acme.c
-+++ b/src/acme.c
-@@ -1,5 +1,5 @@
- /*
-- * Copyright (c) 2009 Intel Corporation. All rights reserved.
-+ * Copyright (c) 2009-2010 Intel Corporation. All rights reserved.
- *
- * This software is available to you under the OpenIB.org BSD license
- * below:
-@@ -39,8 +39,9 @@
- #include <infiniband/acm.h>
- #include "libacm.h"
-
--static char opts_file[100] = "/etc/ibacm/acm_opts.cfg";
--static char addr_file[100] = "/etc/ibacm/acm_addr.cfg";
-+static char dest_dir = "/etc/ibacm";
-+static char opts_file = "acm_opts.cfg";
-+static char addr_file = "acm_addr.cfg";
- static char *dest_addr;
- static char *src_addr;
- static char addr_type = 'i';
-@@ -62,9 +63,11 @@ static void show_usage(char *program)
- printf(" -d dest_addr - format defined by -f option\n");
- printf(" [-v] - verify ACM response against SA query response\n");
- printf("usage 2: %s\n", program);
-- printf(" -A - generate local acm_addr.cfg configuration file\n");
-- printf(" -O - generate local acm_opts.cfg options file\n");
-- printf(" -D - specify destination directory for output files\n");
-+ printf(" -A [addr_file] - generate local address configuration file\n");
-+ printf(" (default is acm_addr.cfg)\n");
-+ printf(" -O [opt_file] - generate local acm_opts.cfg options file\n");
-+ printf(" (default is acm_opts.cfg)\n");
-+ printf(" -D dest_dir - specify destination directory for output files\n");
- printf(" (default is /etc/ibacm)\n");
- }
-
-@@ -195,8 +198,9 @@ static int gen_opts(void)
- FILE *f;
-
- printf("Generating acm_opts.cfg\n");
-+ mkdir(dest_dir, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
- if (!(f = fopen(opts_file, "w"))) {
-- printf("Failed to open option configuration file\n");
-+ printf("Failed to open option configuration file: %s\n", strerror(errno));
- return -1;
- }
-
-@@ -330,8 +334,9 @@ static int gen_addr(void)
- int ret;
-
- printf("Generating acm_addr.cfg\n");
-+ mkdir(dest_dir, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH);
- if (!(f = fopen(addr_file, "w"))) {
-- printf("Failed to open address configuration file\n");
-+ printf("Failed to open address configuration file: %s\n", strerror(errno));
- return -1;
- }
-
-@@ -505,7 +510,7 @@ int CDECL_FUNC main(int argc, char **argv)
- if (ret)
- goto out;
-
-- while ((op = getopt(argc, argv, "f:s:d:vAOD:")) != -1) {
-+ while ((op = getopt(argc, argv, "f:s:d:vA::O::D:")) != -1) {
- switch (op) {
- case 'f':
- addr_type = optarg[0];
-@@ -521,13 +526,19 @@ int CDECL_FUNC main(int argc, char **argv)
- break;
- case 'A':
- make_addr = 1;
-+ if (optarg)
-+ addr_file = optarg;
-+printf("set addr file to %s\n", addr_file);
- break;
- case 'O':
- make_opts = 1;
-+ if (optarg)
-+ opt_file = optarg;
-+printf("set opt file to %s\n", addr_file);
- break;
- case 'D':
-- snprintf(opts_file, 80, "%s/acm_opts.cfg", optarg);
-- snprintf(addr_file, 80, "%s/acm_addr.cfg", optarg);
-+ dest_dir = optarg;
-+printf("set dest dir to %s\n", dest_dir);
- break;
- default:
- show_usage(argv[0]);