]> git.openfabrics.org - ~shefty/ibacm.git/commitdiff
refresh
authorSean Hefty <sean.hefty@intel.com>
Wed, 28 Jul 2010 23:28:02 +0000 (16:28 -0700)
committerSean Hefty <sean.hefty@intel.com>
Wed, 28 Jul 2010 23:28:02 +0000 (16:28 -0700)
meta
patches/cfg
patches/refresh-temp [deleted file]

diff --git a/meta b/meta
index 27497d5595509df5d61943715caf6d20019a2fa4..2594a13a2a9e23050d1c59882857d68140bd9825 100644 (file)
--- a/meta
+++ b/meta
@@ -1,10 +1,9 @@
 Version: 1
-Previous: 09af7fba5bbf9367c2236e511da2aef9d69be772
-Head: 19babedb613988dc0555f0de7df2c5b8081870f0
+Previous: 3a49be9495b8eebc7d552e51f78730fc7196e829
+Head: 66af10c14df1055d97422bc056dc0897ac3a2773
 Applied:
   typo: e733d04dcaf637e600b3f1873befa4e8eaef4f83
   daemon: 7b29fa2e46e60f2cec734b59f7efe8cdeec59660
-  cfg: fa49fb9b31eeb0da36d27b2a85c9b0bf22004da1
-  refresh-temp: 19babedb613988dc0555f0de7df2c5b8081870f0
+  cfg: 66af10c14df1055d97422bc056dc0897ac3a2773
 Unapplied:
 Hidden:
index 88dde7d948ed192434042e64b200d5b5091b98d4..22853171a8e17af387cc806fa67b4ed3043e4c01 100644 (file)
@@ -1,5 +1,5 @@
 Bottom: d4ad38b0621522078c4a0701602ea4b83a80e903
-Top:    09bc4f43699418809ec483f853154e9581482fc0
+Top:    a9a7ff03d17186f855af81adb232170085e921d9
 Author: Sean Hefty <sean.hefty@intel.com>
 Date:   2010-07-23 17:12:24 -0700
 
@@ -15,8 +15,31 @@ Signed-off-by: Sean Hefty <sean.hefty@intel.com>
 
 ---
 
+diff --git a/linux/osd.h b/linux/osd.h
+old mode 100644
+new mode 100755
+index dc8bc1f..722e1b1
+--- a/linux/osd.h
++++ b/linux/osd.h
+@@ -39,11 +39,16 @@
+ #include <pthread.h>\r
+ #include <sys/socket.h>\r
+ #include <sys/types.h>\r
++#include <sys/stat.h>\r
+ #include <malloc.h>\r
+ #include <arpa/inet.h>\r
+ #include <sys/time.h>\r
+ #include <netinet/in.h>\r
\r
++#define ACM_DEST_DIR "/etc/ibacm"\r
++#define ACM_ADDR_FILE "acm_addr.cfg"\r
++#define ACM_OPTS_FILE "acm_opts.cfg"\r
++\r
+ #define LIB_DESTRUCTOR __attribute__((destructor))\r
+ #define CDECL_FUNC\r
\r
 diff --git a/src/acm.c b/src/acm.c
-index 2b1e1fd..afa9917 100755
+index 2b1e1fd..48e622d 100755
 --- a/src/acm.c
 +++ b/src/acm.c
 @@ -191,6 +191,8 @@ static struct acm_client client[FD_SETSIZE - 1];
@@ -53,9 +76,9 @@ index 2b1e1fd..afa9917 100755
 -      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("                      (default %s/%s\n", ACM_DEST_DIR, ACM_ADDR_FILE);
 +      printf("   [-O option_file] - option configuration file\n");
-+      printf("                      (default /etc/ibacm/acm_opts.cfg\n");
++      printf("                      (default %s/%s\n", ACM_DEST_DIR, ACM_OPTS_FILE);
  }
  
  int CDECL_FUNC main(int argc, char **argv)
@@ -81,7 +104,7 @@ index 2b1e1fd..afa9917 100755
 diff --git a/src/acme.c b/src/acme.c
 old mode 100644
 new mode 100755
-index d9d9871..283002b
+index d9d9871..03e96ad
 --- a/src/acme.c
 +++ b/src/acme.c
 @@ -1,5 +1,5 @@
@@ -91,56 +114,91 @@ index d9d9871..283002b
   *
   * This software is available to you under the OpenIB.org BSD license
   * below:
-@@ -39,6 +39,9 @@
+@@ -39,6 +39,10 @@
  #include <infiniband/acm.h>
  #include "libacm.h"
  
-+static char dest_dir = "/etc/ibacm";
-+static char opts_file = "acm_opts.cfg";
-+static char addr_file = "acm_addr.cfg";
++static char *dest_dir = ACM_DEST_DIR;
++static char *addr_file = ACM_ADDR_FILE;
++static char *opts_file = ACM_OPTS_FILE;
++
  static char *dest_addr;
  static char *src_addr;
  static char addr_type = 'i';
-@@ -60,8 +63,12 @@ static void show_usage(char *program)
+@@ -60,8 +64,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("   -A [addr_file]   - generate local address configuration file\n");
-+      printf("                      (default is acm_addr.cfg)\n");
++      printf("                      (default is %s)\n", ACM_ADDR_FILE);
 +      printf("   -O [opt_file]    - generate local acm_opts.cfg options file\n");
-+      printf("                      (default is acm_opts.cfg)\n");
++      printf("                      (default is %s)\n", ACM_OPTS_FILE);
 +      printf("   -D dest_dir      - specify destination directory for output files\n");
-+      printf("                      (default is /etc/ibacm)\n");
++      printf("                      (default is %s)\n", ACM_DEST_DIR);
  }
  
  static void gen_opts_temp(FILE *f)
-@@ -191,8 +198,9 @@ static int gen_opts(void)
+@@ -186,13 +194,23 @@ static void gen_opts_temp(FILE *f)
+       fprintf(f, "\n");
+ }
++static int open_dir(void)
++{
++      mkdir(dest_dir, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
++      if (chdir(dest_dir)) {
++              printf("Failed to open directory %s: %s\n", dest_dir, strerror(errno));
++              return -1;
++      }
++      return 0;
++}
++
+ static int gen_opts(void)
+ {
        FILE *f;
  
-       printf("Generating acm_opts.cfg\n");
+-      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("Generating %s/%s\n", dest_dir, opts_file);
++      if (open_dir() || !(f = fopen(opts_file, "w"))) {
 +              printf("Failed to open option configuration file: %s\n", strerror(errno));
                return -1;
        }
  
-@@ -326,8 +334,9 @@ static int gen_addr(void)
+@@ -325,9 +343,9 @@ static int gen_addr(void)
+       FILE *f;
        int ret;
  
-       printf("Generating acm_addr.cfg\n");
+-      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("Generating %s/%s\n", dest_dir, addr_file);
++      if (open_dir() || !(f = fopen(addr_file, "w"))) {
 +              printf("Failed to open address configuration file: %s\n", strerror(errno));
                return -1;
        }
  
-@@ -501,7 +510,7 @@ int CDECL_FUNC main(int argc, char **argv)
+@@ -493,6 +511,17 @@ static int resolve(char *program)
+       return ret;
+ }
++char *opt_arg(int argc, char **argv)
++{
++      if (optarg)
++              return optarg;
++
++      if ((optind < argc) && (argv[optind][0] != '-'))
++              return argv[optind];
++
++      return NULL;
++}
++
+ int CDECL_FUNC main(int argc, char **argv)
+ {
+       int op, ret;
+@@ -501,7 +530,7 @@ int CDECL_FUNC main(int argc, char **argv)
        if (ret)
                goto out;
  
@@ -149,23 +207,20 @@ index d9d9871..283002b
                switch (op) {
                case 'f':
                        addr_type = optarg[0];
-@@ -517,9 +526,19 @@ int CDECL_FUNC main(int argc, char **argv)
+@@ -517,9 +546,16 @@ 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);
++                      if (opt_arg(argc, argv))
++                              addr_file = opt_arg(argc, argv);
                        break;
                case 'O':
                        make_opts = 1;
-+                      if (optarg)
-+                              opt_file = optarg;
-+printf("set opt file to %s\n", addr_file);
++                      if (opt_arg(argc, argv))
++                              opts_file = opt_arg(argc, argv);
 +                      break;
 +              case 'D':
 +                      dest_dir = optarg;
-+printf("set dest dir to %s\n", dest_dir);
                        break;
                default:
                        show_usage(argv[0]);
diff --git a/patches/refresh-temp b/patches/refresh-temp
deleted file mode 100644 (file)
index 2c8f10a..0000000
+++ /dev/null
@@ -1,161 +0,0 @@
-Bottom: 09bc4f43699418809ec483f853154e9581482fc0
-Top:    a9a7ff03d17186f855af81adb232170085e921d9
-Author: Sean Hefty <sean.hefty@intel.com>
-Date:   2010-07-28 16:28:02 -0700
-
-Refresh of cfg
-
----
-
-diff --git a/linux/osd.h b/linux/osd.h
-old mode 100644
-new mode 100755
-index dc8bc1f..722e1b1
---- a/linux/osd.h
-+++ b/linux/osd.h
-@@ -39,11 +39,16 @@
- #include <pthread.h>\r
- #include <sys/socket.h>\r
- #include <sys/types.h>\r
-+#include <sys/stat.h>\r
- #include <malloc.h>\r
- #include <arpa/inet.h>\r
- #include <sys/time.h>\r
- #include <netinet/in.h>\r
\r
-+#define ACM_DEST_DIR "/etc/ibacm"\r
-+#define ACM_ADDR_FILE "acm_addr.cfg"\r
-+#define ACM_OPTS_FILE "acm_opts.cfg"\r
-+\r
- #define LIB_DESTRUCTOR __attribute__((destructor))\r
- #define CDECL_FUNC\r
\r
-diff --git a/src/acm.c b/src/acm.c
-index afa9917..48e622d 100755
---- a/src/acm.c
-+++ b/src/acm.c
-@@ -2642,9 +2642,9 @@ static void show_usage(char *program)
-       printf("usage: %s\n", program);
-       printf("   [-D]             - run as a daemon\n");
-       printf("   [-A addr_file]   - address configuration file\n");
--      printf("                      (default /etc/ibacm/acm_addr.cfg\n");
-+      printf("                      (default %s/%s\n", ACM_DEST_DIR, ACM_ADDR_FILE);
-       printf("   [-O option_file] - option configuration file\n");
--      printf("                      (default /etc/ibacm/acm_opts.cfg\n");
-+      printf("                      (default %s/%s\n", ACM_DEST_DIR, ACM_OPTS_FILE);
- }
- int CDECL_FUNC main(int argc, char **argv)
-diff --git a/src/acme.c b/src/acme.c
-index 283002b..03e96ad 100755
---- a/src/acme.c
-+++ b/src/acme.c
-@@ -39,9 +39,10 @@
- #include <infiniband/acm.h>
- #include "libacm.h"
--static char dest_dir = "/etc/ibacm";
--static char opts_file = "acm_opts.cfg";
--static char addr_file = "acm_addr.cfg";
-+static char *dest_dir = ACM_DEST_DIR;
-+static char *addr_file = ACM_ADDR_FILE;
-+static char *opts_file = ACM_OPTS_FILE;
-+
- static char *dest_addr;
- static char *src_addr;
- static char addr_type = 'i';
-@@ -64,11 +65,11 @@ static void show_usage(char *program)
-       printf("   [-v]             - verify ACM response against SA query response\n");
-       printf("usage 2: %s\n", program);
-       printf("   -A [addr_file]   - generate local address configuration file\n");
--      printf("                      (default is acm_addr.cfg)\n");
-+      printf("                      (default is %s)\n", ACM_ADDR_FILE);
-       printf("   -O [opt_file]    - generate local acm_opts.cfg options file\n");
--      printf("                      (default is acm_opts.cfg)\n");
-+      printf("                      (default is %s)\n", ACM_OPTS_FILE);
-       printf("   -D dest_dir      - specify destination directory for output files\n");
--      printf("                      (default is /etc/ibacm)\n");
-+      printf("                      (default is %s)\n", ACM_DEST_DIR);
- }
- static void gen_opts_temp(FILE *f)
-@@ -193,13 +194,22 @@ static void gen_opts_temp(FILE *f)
-       fprintf(f, "\n");
- }
-+static int open_dir(void)
-+{
-+      mkdir(dest_dir, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH);
-+      if (chdir(dest_dir)) {
-+              printf("Failed to open directory %s: %s\n", dest_dir, strerror(errno));
-+              return -1;
-+      }
-+      return 0;
-+}
-+
- 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("Generating %s/%s\n", dest_dir, opts_file);
-+      if (open_dir() || !(f = fopen(opts_file, "w"))) {
-               printf("Failed to open option configuration file: %s\n", strerror(errno));
-               return -1;
-       }
-@@ -333,9 +343,8 @@ static int gen_addr(void)
-       FILE *f;
-       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("Generating %s/%s\n", dest_dir, addr_file);
-+      if (open_dir() || !(f = fopen(addr_file, "w"))) {
-               printf("Failed to open address configuration file: %s\n", strerror(errno));
-               return -1;
-       }
-@@ -502,6 +511,17 @@ static int resolve(char *program)
-       return ret;
- }
-+char *opt_arg(int argc, char **argv)
-+{
-+      if (optarg)
-+              return optarg;
-+
-+      if ((optind < argc) && (argv[optind][0] != '-'))
-+              return argv[optind];
-+
-+      return NULL;
-+}
-+
- int CDECL_FUNC main(int argc, char **argv)
- {
-       int op, ret;
-@@ -526,19 +546,16 @@ 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);
-+                      if (opt_arg(argc, argv))
-+                              addr_file = opt_arg(argc, argv);
-                       break;
-               case 'O':
-                       make_opts = 1;
--                      if (optarg)
--                              opt_file = optarg;
--printf("set opt file to %s\n", addr_file);
-+                      if (opt_arg(argc, argv))
-+                              opts_file = opt_arg(argc, argv);
-                       break;
-               case 'D':
-                       dest_dir = optarg;
--printf("set dest dir to %s\n", dest_dir);
-                       break;
-               default:
-                       show_usage(argv[0]);