]> git.openfabrics.org - ~shefty/ibacm.git/commitdiff
refresh (create temporary patch)
authorSean Hefty <sean.hefty@intel.com>
Thu, 22 Mar 2012 20:54:33 +0000 (13:54 -0700)
committerSean Hefty <sean.hefty@intel.com>
Thu, 22 Mar 2012 20:54:33 +0000 (13:54 -0700)
meta
patches/refresh-temp [new file with mode: 0644]

diff --git a/meta b/meta
index 55617bb6ae1257d35e6528ef52b2e947b3433f61..5587259687566c0f1ccf20331c1d6936016740cc 100644 (file)
--- a/meta
+++ b/meta
@@ -1,10 +1,11 @@
 Version: 1
-Previous: 7a6a7bdc55c6a47cf295e671ebbe4298adeef8b8
-Head: b72172dfaa9c545e69b1f3c528404af3a81f01a1
+Previous: 861ff063451614a2eac7932389821563576f8df8
+Head: 5ac0516470e37dc2e1329181b000fb6ef622eb0c
 Applied:
   af_ib: fb683ba55480ada43c09aa48b3cb18bde139f72c
   rename-ibacm: 62fc4bdee12905d85332875439240523fad7bee0
   file-loc: b72172dfaa9c545e69b1f3c528404af3a81f01a1
+  refresh-temp: 5ac0516470e37dc2e1329181b000fb6ef622eb0c
 Unapplied:
   init-script: 0eb36b8d494d7d51ed3d25c71289c2f5abd845f9
   fixup-man: 3b3d0caee4b583c2853c12c6728dbfac03d544f9
diff --git a/patches/refresh-temp b/patches/refresh-temp
new file mode 100644 (file)
index 0000000..1458b5e
--- /dev/null
@@ -0,0 +1,85 @@
+Bottom: b7ef43780109283b77986862aa8504222eb78bce
+Top:    ffbf8e3093adb07029773e3639a285aa6a0f7971
+Author: Sean Hefty <sean.hefty@intel.com>
+Date:   2012-03-22 13:54:33 -0700
+
+Refresh of file-loc
+
+---
+
+diff --git a/linux/osd.h b/linux/osd.h
+index 33ea842..f085a58 100644
+--- a/linux/osd.h
++++ b/linux/osd.h
+@@ -45,9 +45,9 @@
+ #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
++#define ACM_DEST_DIR "/etc/rdma"\r
++#define ACM_ADDR_FILE "ibacm_addr.cfg"\r
++#define ACM_OPTS_FILE "ibacm_opts.cfg"\r
\r
+ #define LIB_DESTRUCTOR __attribute__((destructor))\r
+ #define CDECL_FUNC\r
+diff --git a/src/acm.c b/src/acm.c
+index 906c926..8a8d576 100644
+--- a/src/acm.c
++++ b/src/acm.c
+@@ -205,11 +205,12 @@ static atomic_t counter[ACM_MAX_COUNTER];
+ /*
+  * Service options - may be set through acm_opts file.
+  */
+-static char *opts_file = "/etc/ibacm/acm_opts.cfg";
+-static char *addr_file = "/etc/ibacm/acm_addr.cfg";
++static char *opts_file = ACM_DEST_DIR "/" ACM_OPTS_FILE;//"/etc/rdma/ibacm_opts.cfg";
++static char *addr_file = ACM_DEST_DIR "/" ACM_ADDR_FILE;//"/etc/rdma/ibacm_addr.cfg";
+ static char log_file[128] = "/var/log/ibacm.log";
+ static int log_level = 0;
+-static char lock_file[128] = "/var/lock/ibacm.pid";
++static char pid_file[128] = "/var/run/ibacm.pid";
++static char lock_file[128] = "/var/run/subsys/ibacm";
+ static enum acm_addr_prot addr_prot = ACM_ADDR_PROT_ACM;
+ static enum acm_route_prot route_prot = ACM_ROUTE_PROT_ACM;
+ static enum acm_loopback_prot loopback_prot = ACM_LOOPBACK_PROT_LOCAL;
+@@ -3111,21 +3112,33 @@ static FILE *acm_open_log(void)
+ static int acm_open_lock_file(void)
+ {
+-      int lock_fd;
++      int lock_fd, pid_fd;
+       char pid[16];
+       lock_fd = open(lock_file, O_RDWR | O_CREAT, 0640);
+       if (lock_fd < 0)
+               return lock_fd;
+-      if (lockf(lock_fd, F_TLOCK, 0)) {
+-              close(lock_fd);
+-              return -1;
+-      }
++      pid_fd = open(pid_file, O_RDWR | O_CREAT, 0640);
++      if (pid_fd < 0)
++              goto err1;
++
++      if (lockf(lock_fd, F_TLOCK, 0))
++              goto err2;
++
++      if (lockf(pid_fd, F_TLOCK, 0))
++              goto err2;
+       sprintf(pid, "%d\n", getpid());
+       write(lock_fd, pid, strlen(pid));
++      write(pid_fd, pid, strlen(pid));
+       return 0;
++
++err2:
++      close(pid_fd);
++err1:
++      close(lock_fd);
++      return -1;
+ }
+ static void daemonize(void)