]> git.openfabrics.org - ~shefty/ibacm.git/commitdiff
refresh (create temporary patch)
authorSean Hefty <sean.hefty@intel.com>
Sat, 24 Jul 2010 01:01:21 +0000 (18:01 -0700)
committerSean Hefty <sean.hefty@intel.com>
Sat, 24 Jul 2010 01:01:21 +0000 (18:01 -0700)
meta
patches/refresh-temp [new file with mode: 0644]

diff --git a/meta b/meta
index b370f076537f29b4cdce9c8d261cdb0354f8faa1..bd35096442a5e4afcd1e2ac4e480bf47b395b99d 100644 (file)
--- a/meta
+++ b/meta
@@ -1,9 +1,10 @@
 Version: 1
-Previous: 5a505514b1471556208d791179cb7bc593757f6c
-Head: 4339147e98565cbe100d1378a378499e6d70c223
+Previous: a5133347129763fd51e0cea899be919a460aa0b6
+Head: 3b7d4d60240612608bee3bacb34e4cf110803577
 Applied:
   typo: e733d04dcaf637e600b3f1873befa4e8eaef4f83
   daemon: 7b29fa2e46e60f2cec734b59f7efe8cdeec59660
   cfg: 4339147e98565cbe100d1378a378499e6d70c223
+  refresh-temp: 3b7d4d60240612608bee3bacb34e4cf110803577
 Unapplied:
 Hidden:
diff --git a/patches/refresh-temp b/patches/refresh-temp
new file mode 100644 (file)
index 0000000..c4f0541
--- /dev/null
@@ -0,0 +1,114 @@
+Bottom: d4ad38b0621522078c4a0701602ea4b83a80e903
+Top:    3daa31d8f3455847d0120c57262abe465bd61e37
+Author: Sean Hefty <sean.hefty@intel.com>
+Date:   2010-07-23 18:01:21 -0700
+
+Refresh of cfg
+
+---
+
+diff --git a/src/acm.c b/src/acm.c
+index 2b1e1fd..53499f9 100755
+--- a/src/acm.c
++++ b/src/acm.c
+@@ -191,6 +191,8 @@ static struct acm_client client[FD_SETSIZE - 1];
+ static FILE *flog;
+ static lock_t log_lock;
++static char *opts_file = "/etc/ibacm/acm_opts.cfg"
++static char *addr_file = "/etc/ibacm/acm_addr.cfg"
+ static char log_file[128] = "stdout";
+ static int log_level = 0;
+ static enum acm_addr_prot addr_prot = ACM_ADDR_PROT_ACM;
+@@ -2638,7 +2640,11 @@ static void daemonize(void)
+ static void show_usage(char *program)
+ {
+       printf("usage: %s\n", program);
+-      printf("   [-D] - run as a daemon\n");
++      printf("   [-D]             - run as a daemon\n");
++      printf("   [-A addr_file]   - address configuration file\n");
++      printf("                      (default /etc/ibacm/acm_addr.cfg\n");
++      printf("   [-O option_file] - option configuration file\n");
++      printf("                      (default /etc/ibacm/acm_opts.cfg\n");
+ }
+ int CDECL_FUNC main(int argc, char **argv)
+@@ -2647,11 +2653,17 @@ int CDECL_FUNC main(int argc, char **argv)
+       int dev_cnt;
+       int op, i, daemon = 0;
+-      while ((op = getopt(argc, argv, "D")) != -1) {
++      while ((op = getopt(argc, argv, "DA:O:")) != -1) {
+               switch (op) {
+               case 'D':
+                       daemon = 1;
+                       break;
++              case 'A':
++                      addr_file = optarg;
++                      break;
++              case 'O':
++                      opts_file = optarg;
++                      break;
+               default:
+                       show_usage(argv[0]);
+                       exit(1);
+diff --git a/src/acme.c b/src/acme.c
+index d9d9871..42a5397 100644
+--- a/src/acme.c
++++ b/src/acme.c
+@@ -39,6 +39,8 @@
+ #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_addr;
+ static char *src_addr;
+ static char addr_type = 'i';
+@@ -62,6 +64,8 @@ static void show_usage(char *program)
+       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("                      (default is /etc/ibacm)\n");
+ }
+ static void gen_opts_temp(FILE *f)
+@@ -191,7 +195,7 @@ static int gen_opts(void)
+       FILE *f;
+       printf("Generating acm_opts.cfg\n");
+-      if (!(f = fopen("acm_opts.cfg", "w"))) {
++      if (!(f = fopen(opts_file, "w"))) {
+               printf("Failed to open option configuration file\n");
+               return -1;
+       }
+@@ -326,7 +330,7 @@ static int gen_addr(void)
+       int ret;
+       printf("Generating acm_addr.cfg\n");
+-      if (!(f = fopen("acm_addr.cfg", "w"))) {
++      if (!(f = fopen(addr_file, "w"))) {
+               printf("Failed to open address configuration file\n");
+               return -1;
+       }
+@@ -501,7 +505,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) {
+               switch (op) {
+               case 'f':
+                       addr_type = optarg[0];
+@@ -521,6 +525,10 @@ int CDECL_FUNC main(int argc, char **argv)
+               case 'O':
+                       make_opts = 1;
+                       break;
++              case 'D':
++                      snprintf(opts_file, "%s/acm_opts.cfg", 80, optarg);
++                      snprintf(addr_file, "%s/acm_addr.cfg", 80, optarg);
++                      break;
+               default:
+                       show_usage(argv[0]);
+                       exit(1);