Version: 1
-Previous: 3e710927cbc18cf45aa466aba43e3422d6cd16f7
-Head: 544b638d2560cedf3a1b0ca3897e95d3f52c81d3
+Previous: 051c5eb9970ffbc19e8c31482731d3195302245e
+Head: 8af58bd7ff7dcc728289acfab8b629877ee0b6f8
Applied:
autoaddr: f7b588cb0a484c2a15c5bd81ef101c815bd992ee
addr_open: 544b638d2560cedf3a1b0ca3897e95d3f52c81d3
+ refresh-temp: 8af58bd7ff7dcc728289acfab8b629877ee0b6f8
Unapplied:
async_mc: c51c6e84981821b2541daba97cee9a29cd1d3709
addr_size: 8de02c47fbf595132105a7050ad6f755f49f9a7a
--- /dev/null
+Bottom: d65a2839777e9248477661e92509a1f24ef35537
+Top: 4ab29560f27d5a7097e5210fa3315e024bf134a3
+Author: Sean Hefty <sean.hefty@intel.com>
+Date: 2011-01-20 13:23:53 -0800
+
+Refresh of addr_open
+
+---
+
+diff --git a/src/acm.c b/src/acm.c
+index 0338e80..5f58cf0 100644
+--- a/src/acm.c
++++ b/src/acm.c
+@@ -203,7 +203,6 @@ 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];
+
+@@ -2390,6 +2389,7 @@ err:
+
+ static int acm_assign_ep_names(struct acm_ep *ep)
+ {
++ FILE *faddr;
+ char *dev_name;
+ char s[120];
+ char dev[32], addr[32], pkey_str[8];
+@@ -2402,7 +2402,11 @@ 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);
+
+- rewind(faddr);
++ if (!(faddr = acm_open_addr_file())) {
++ acm_log(0, "ERROR - address file not found\n");
++ return -1;
++ }
++
+ while (fgets(s, sizeof s, faddr)) {
+ if (s[0] == '#')
+ continue;
+@@ -2446,6 +2450,7 @@ static int acm_assign_ep_names(struct acm_ep *ep)
+ }
+ }
+ }
++ fclose(faddr);
+
+ return !index;
+ }
+@@ -2974,11 +2979,6 @@ 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) {
+@@ -2995,7 +2995,6 @@ int CDECL_FUNC main(int argc, char **argv)
+ acm_log(0, "ERROR - no active devices\n");
+ return -1;
+ }
+- fclose(faddr);
+
+ acm_log(1, "initiating multicast joins\n");
+ acm_join_groups();