]> git.openfabrics.org - ~shefty/ibacm.git/commitdiff
refresh (create temporary patch)
authorSean Hefty <sean.hefty@intel.com>
Wed, 28 Jul 2010 19:26:49 +0000 (12:26 -0700)
committerSean Hefty <sean.hefty@intel.com>
Wed, 28 Jul 2010 19:26:49 +0000 (12:26 -0700)
meta
patches/refresh-temp [new file with mode: 0644]

diff --git a/meta b/meta
index 64adb52e6f1e549c47e770dcc5508271b0165189..69ff19f3f365f50c4d8669821a5574d7d9d607c2 100644 (file)
--- a/meta
+++ b/meta
@@ -1,9 +1,10 @@
 Version: 1
-Previous: 0a9901535a259ed0f581fd04b8660e1f765d2832
-Head: c3810c2aa0b1a83a4c8525de58f8e17bb5d5dad6
+Previous: d5cbb9b40091392900460d0ea4501b27ebc5b344
+Head: 122174ed75b45d4d6c218d4c6ca5d3837f263538
 Applied:
   typo: e733d04dcaf637e600b3f1873befa4e8eaef4f83
   daemon: 7b29fa2e46e60f2cec734b59f7efe8cdeec59660
   cfg: c3810c2aa0b1a83a4c8525de58f8e17bb5d5dad6
+  refresh-temp: 122174ed75b45d4d6c218d4c6ca5d3837f263538
 Unapplied:
 Hidden:
diff --git a/patches/refresh-temp b/patches/refresh-temp
new file mode 100644 (file)
index 0000000..2bd0b67
--- /dev/null
@@ -0,0 +1,100 @@
+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]);