Version: 1
-Previous: 8e42484fcd00caa5f794faae319942e83a6157ec
-Head: 5d0d124ee1c6e7568f601ff3080bddba0aab22e7
+Previous: 80f61946f8a8696ce0ad0cabc346294c0bdba806
+Head: ba69cc56817c208b18120572a14f8f1e9ae90a66
Applied:
af_ib: fb683ba55480ada43c09aa48b3cb18bde139f72c
rename-ibacm: 62fc4bdee12905d85332875439240523fad7bee0
- file-loc: c24acfe89c026133584c66501bdfececb3554b4b
- refresh-temp: 5d0d124ee1c6e7568f601ff3080bddba0aab22e7
+ file-loc: ba69cc56817c208b18120572a14f8f1e9ae90a66
Unapplied:
init-script: 0eb36b8d494d7d51ed3d25c71289c2f5abd845f9
fixup-man: 3b3d0caee4b583c2853c12c6728dbfac03d544f9
Bottom: b7ef43780109283b77986862aa8504222eb78bce
-Top: ffbf8e3093adb07029773e3639a285aa6a0f7971
+Top: 80a25ead5e5cb7d2944f448fe3bd29145d9aaf0f
Author: Sean Hefty <sean.hefty@intel.com>
Date: 2012-03-22 10:29:46 -0700
#define LIB_DESTRUCTOR __attribute__((destructor))\r
#define CDECL_FUNC\r
diff --git a/src/acm.c b/src/acm.c
-index 906c926..8a8d576 100644
+index 906c926..f0c33d4 100644
--- a/src/acm.c
+++ b/src/acm.c
-@@ -205,11 +205,12 @@ static atomic_t counter[ACM_MAX_COUNTER];
+@@ -205,11 +205,11 @@ static atomic_t counter[ACM_MAX_COUNTER];
/*
* Service options - may be set through acm_opts file.
*/
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 char lock_file[128] = "/var/run/ibacm.pid";
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)
+++ /dev/null
-Bottom: ffbf8e3093adb07029773e3639a285aa6a0f7971
-Top: 80a25ead5e5cb7d2944f448fe3bd29145d9aaf0f
-Author: Sean Hefty <sean.hefty@intel.com>
-Date: 2012-03-22 14:06:09 -0700
-
-Refresh of file-loc
-
----
-
-diff --git a/src/acm.c b/src/acm.c
-index 8a8d576..f0c33d4 100644
---- a/src/acm.c
-+++ b/src/acm.c
-@@ -209,8 +209,7 @@ static char *opts_file = ACM_DEST_DIR "/" ACM_OPTS_FILE;//"/etc/rdma/ibacm_opts.
- 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 pid_file[128] = "/var/run/ibacm.pid";
--static char lock_file[128] = "/var/run/subsys/ibacm";
-+static char lock_file[128] = "/var/run/ibacm.pid";
- 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;
-@@ -3112,33 +3111,21 @@ static FILE *acm_open_log(void)
-
- static int acm_open_lock_file(void)
- {
-- int lock_fd, pid_fd;
-+ int lock_fd;
- char pid[16];
-
- lock_fd = open(lock_file, O_RDWR | O_CREAT, 0640);
- if (lock_fd < 0)
- return lock_fd;
-
-- 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;
-+ if (lockf(lock_fd, F_TLOCK, 0)) {
-+ close(lock_fd);
-+ return -1;
-+ }
-
- 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)