Version: 1
-Previous: 72dcc1713e53c0f4627978e7c3fde5097a9c89d8
-Head: 71b582986ee39cbadfa9192c9ba5a90196de8dab
+Previous: 9fd798cb1cffc438ccc422057302cb74ac5f12d8
+Head: 45d0dbe31df5f9be4ecdb6db28e050537c97dd31
Applied:
logging: 549692c49922dce3911d97dcc6d0a2fc583ab5f7
acm_snoop: dd5542fbaa1c5a92367d0552ef3525d5ea0a4638
locking: 558e5577364aec3531c54b28def6e16f0c926524
verbose: 15cf7a7a260a694923bcb5c9181b10b0f02108f7
dbg_1: 0b650c149079cd8e1593504492a9940521fb9c6d
- no_active: 371506a83d025ba296459fb6b0be2e04ccb82418
- refresh-temp: 71b582986ee39cbadfa9192c9ba5a90196de8dab
+ no_active: 45d0dbe31df5f9be4ecdb6db28e050537c97dd31
Unapplied:
acme_verbose: 45cba0846874c93ef7af156bf0afe59f43d82ea6
1.0.4: 9f452b8e59adb21b90fbdda980d25a54d4360d37
Bottom: 5e7b11ab34ad911d8a6551337d36c51be1b092b4
-Top: fc046737101d8f0b0b7e747265c57fec539e34e4
+Top: a307944fa3171b48a0b7c8ad9cb0218ce45d24c2
Author: Sean Hefty <sean.hefty@intel.com>
Date: 2010-12-06 11:06:47 -0800
---
diff --git a/src/acm.c b/src/acm.c
-index 9ff81c4..fce0fc9 100644
+index 9ff81c4..14cbfd6 100644
--- a/src/acm.c
+++ b/src/acm.c
-@@ -2825,6 +2825,10 @@ int CDECL_FUNC main(int argc, char **argv)
+@@ -203,6 +203,7 @@ static SOCKET listen_socket;
+ static struct acm_client client[FD_SETSIZE - 1];
+
+ static FILE *flog;
++static FILE *faddr;
+ static lock_t log_lock;
+ PER_THREAD char log_data[ACM_MAX_ADDRESS];
+
+@@ -2261,11 +2262,7 @@ static int acm_assign_ep_names(struct acm_ep *ep)
+ acm_log(1, "device %s, port %d, pkey 0x%x\n",
+ dev_name, ep->port->port_num, ep->pkey);
+
+- if (!(f = fopen(addr_file, "r"))) {
+- acm_log(0, "ERROR - unable to open acm_addr.cfg file\n");
+- return ACM_STATUS_ENODATA;
+- }
+-
++ rewind(faddr);
+ while (fgets(s, sizeof s, f)) {
+ if (s[0] == '#')
+ continue;
+@@ -2310,7 +2307,6 @@ static int acm_assign_ep_names(struct acm_ep *ep)
+ }
+ }
+
+- fclose(f);
+ return !index;
+ }
+
+@@ -2722,6 +2718,22 @@ static FILE *acm_open_log(void)
+ return f;
+ }
+
++static FILE *acm_open_addr_file(void)
++{
++ FILE *f;
++
++ if ((f = fopen(addr_file, "r"))
++ return f;
++
++ acm_log(0, "notice - generating acm_addr.cfg file\n");
++ if (!(f = popen("ib_acm -A", "r"))) {
++ acm_log(0, "ERROR - cannot generate acm_addr.cfg\n");
++ return NULL;
++ }
++ pclose(f);
++ return fopen(addr_file, "r");
++}
++
+ static int acm_open_lock_file(void)
+ {
+ int lock_fd;
+@@ -2813,6 +2825,11 @@ int CDECL_FUNC main(int argc, char **argv)
+ DListInit(&timeout_list);
+ event_init(&timeout_event);
+
++ if (faddr = acm_open_addr_file()) {
++ acm_log(0, "ERROR - address file not found\n");
++ return -1
++ }
++
+ umad_init();
+ ibdev = ibv_get_device_list(&dev_cnt);
+ if (!ibdev) {
+@@ -2825,6 +2842,11 @@ int CDECL_FUNC main(int argc, char **argv)
acm_open_dev(ibdev[i]);
ibv_free_device_list(ibdev);
++ fclose(faddr);
+ if (DListEmpty(&dev_list)) {
+ acm_log(0, "ERROR - no active devices\n");
+ return -1;
+++ /dev/null
-Bottom: fc046737101d8f0b0b7e747265c57fec539e34e4
-Top: a307944fa3171b48a0b7c8ad9cb0218ce45d24c2
-Author: Sean Hefty <sean.hefty@intel.com>
-Date: 2010-12-06 11:27:00 -0800
-
-Refresh of no_active
-
----
-
-diff --git a/src/acm.c b/src/acm.c
-index fce0fc9..14cbfd6 100644
---- a/src/acm.c
-+++ b/src/acm.c
-@@ -203,6 +203,7 @@ static SOCKET listen_socket;
- static struct acm_client client[FD_SETSIZE - 1];
-
- static FILE *flog;
-+static FILE *faddr;
- static lock_t log_lock;
- PER_THREAD char log_data[ACM_MAX_ADDRESS];
-
-@@ -2261,11 +2262,7 @@ static int acm_assign_ep_names(struct acm_ep *ep)
- acm_log(1, "device %s, port %d, pkey 0x%x\n",
- dev_name, ep->port->port_num, ep->pkey);
-
-- if (!(f = fopen(addr_file, "r"))) {
-- acm_log(0, "ERROR - unable to open acm_addr.cfg file\n");
-- return ACM_STATUS_ENODATA;
-- }
--
-+ rewind(faddr);
- while (fgets(s, sizeof s, f)) {
- if (s[0] == '#')
- continue;
-@@ -2310,7 +2307,6 @@ static int acm_assign_ep_names(struct acm_ep *ep)
- }
- }
-
-- fclose(f);
- return !index;
- }
-
-@@ -2722,6 +2718,22 @@ static FILE *acm_open_log(void)
- return f;
- }
-
-+static FILE *acm_open_addr_file(void)
-+{
-+ FILE *f;
-+
-+ if ((f = fopen(addr_file, "r"))
-+ return f;
-+
-+ acm_log(0, "notice - generating acm_addr.cfg file\n");
-+ if (!(f = popen("ib_acm -A", "r"))) {
-+ acm_log(0, "ERROR - cannot generate acm_addr.cfg\n");
-+ return NULL;
-+ }
-+ pclose(f);
-+ return fopen(addr_file, "r");
-+}
-+
- static int acm_open_lock_file(void)
- {
- int lock_fd;
-@@ -2813,6 +2825,11 @@ int CDECL_FUNC main(int argc, char **argv)
- DListInit(&timeout_list);
- event_init(&timeout_event);
-
-+ if (faddr = acm_open_addr_file()) {
-+ acm_log(0, "ERROR - address file not found\n");
-+ return -1
-+ }
-+
- umad_init();
- ibdev = ibv_get_device_list(&dev_cnt);
- if (!ibdev) {
-@@ -2825,6 +2842,7 @@ int CDECL_FUNC main(int argc, char **argv)
- acm_open_dev(ibdev[i]);
-
- ibv_free_device_list(ibdev);
-+ fclose(faddr);
- if (DListEmpty(&dev_list)) {
- acm_log(0, "ERROR - no active devices\n");
- return -1;