]> git.openfabrics.org - ~shefty/ibacm.git/commitdiff
refresh
authorSean Hefty <sean.hefty@intel.com>
Mon, 23 Apr 2012 16:13:13 +0000 (09:13 -0700)
committerSean Hefty <sean.hefty@intel.com>
Mon, 23 Apr 2012 16:13:13 +0000 (09:13 -0700)
meta
patches/refresh-temp [deleted file]
patches/snprintf

diff --git a/meta b/meta
index 0e0978b14b75c7724b245c43ede720b3d2aba66e..b62fbc904cb7937e293557f0e5aebb34e581f404 100644 (file)
--- a/meta
+++ b/meta
@@ -1,9 +1,8 @@
 Version: 1
-Previous: b4489550fa10e69e17183660c553ca903a5fb7f0
-Head: 2f3fd8561351304c0035073782f7c95d79736643
+Previous: c4f9883131b45a0f3c2171f528eef41f83484d63
+Head: 5d8f3e29f8552ed33e63d57056f17abe2602632a
 Applied:
-  snprintf: 6abff37c0446ac6bc2b9a3f355c8b56b850d52c7
-  refresh-temp: 2f3fd8561351304c0035073782f7c95d79736643
+  snprintf: 5d8f3e29f8552ed33e63d57056f17abe2602632a
 Unapplied:
   dev-name2ip: 8e00708e882239292492e13aa51c82042255933c
   dev-addrsize: 8de02c47fbf595132105a7050ad6f755f49f9a7a
diff --git a/patches/refresh-temp b/patches/refresh-temp
deleted file mode 100644 (file)
index 9e5c915..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-Bottom: 94cf3ac2f65474e3ae10d0759a997a516a0f0222
-Top:    18781a75a9389459fd54f05e6690f13c88dca330
-Author: Sean Hefty <sean.hefty@intel.com>
-Date:   2012-04-23 09:13:13 -0700
-
-Refresh of snprintf
-
----
-
-diff --git a/linux/acme_linux.c b/linux/acme_linux.c
-index 9477d29..1039645 100644
---- a/linux/acme_linux.c
-+++ b/linux/acme_linux.c
-@@ -53,7 +53,7 @@ get_pkey(struct ifreq *ifreq, uint16_t *pkey)
-       FILE *f;
-       int ret;
--      sprintf(buf, "//sys//class//net//%s//pkey", ifreq->ifr_name);
-+      snprintf(buf, sizeof buf, "//sys//class//net//%s//pkey", ifreq->ifr_name);
-       f = fopen(buf, "r");
-       if (!f) {
-               printf("failed to open %s\n", buf);
-@@ -79,7 +79,7 @@ get_sgid(struct ifreq *ifr, union ibv_gid *sgid)
-       FILE *f;
-       int i, p, ret;
--      sprintf(buf, "//sys//class//net//%s//address", ifr->ifr_name);
-+      snprintf(buf, sizeof buf, "//sys//class//net//%s//address", ifr->ifr_name);
-       f = fopen(buf, "r");
-       if (!f) {
-               printf("failed to open %s\n", buf);
-diff --git a/src/acm.c b/src/acm.c
-index 099e84e..376f294 100644
---- a/src/acm.c
-+++ b/src/acm.c
-@@ -268,7 +268,7 @@ acm_format_name(int level, char *name, size_t name_size,
-       case ACM_EP_INFO_PATH:
-               path = (struct ibv_path_record *) addr;
-               if (path->dlid) {
--                      sprintf(name, "SLID(%u) DLID(%u)",
-+                      snprintf(name, name_size, "SLID(%u) DLID(%u)",
-                               ntohs(path->slid), ntohs(path->dlid));
-               } else {
-                       acm_format_name(level, name, name_size, ACM_ADDRESS_GID,
-@@ -276,7 +276,7 @@ acm_format_name(int level, char *name, size_t name_size,
-               }
-               break;
-       case ACM_ADDRESS_LID:
--              sprintf(name, "LID(%u)", ntohs(*((uint16_t *) addr)));
-+              snprintf(name, name_size, "LID(%u)", ntohs(*((uint16_t *) addr)));
-               break;
-       default:
-               strcpy(name, "Unknown");
-@@ -3125,7 +3125,7 @@ static int acm_open_lock_file(void)
-               return -1;
-       }
--      sprintf(pid, "%d\n", getpid());
-+      snprintf(pid, sizeof pid, "%d\n", getpid());
-       write(lock_fd, pid, strlen(pid));
-       return 0;
- }
-diff --git a/src/parse.c b/src/parse.c
-index 9a01afb..83ce843 100644
---- a/src/parse.c
-+++ b/src/parse.c
-@@ -52,7 +52,7 @@ static char *expand(char *basename, char *args, int *str_cnt, int *str_size)
-               }
-               while (from <= to) {
--                      sprintf(buf, "%s%0*d", basename, width, from);
-+                      snprintf(buf, sizeof buf, "%s%0*d", basename, width, from);
-                       str_buf = realloc(str_buf, size + strlen(buf)+1);
-                       strcpy(&str_buf[size], buf);
index 6eb44fc6312fe422e5867430d27df0d9b16d39e9..c41dceac2a53b27ebbcf605353223e1e9cbf9925 100644 (file)
@@ -1,5 +1,5 @@
 Bottom: 94cf3ac2f65474e3ae10d0759a997a516a0f0222
-Top:    94cf3ac2f65474e3ae10d0759a997a516a0f0222
+Top:    18781a75a9389459fd54f05e6690f13c88dca330
 Author: Dotan Barak <dotanb@dev.mellanox.co.il>
 Date:   2012-04-23 09:09:44 -0700
 
@@ -14,4 +14,68 @@ Signed-off-by: Sean Hefty <sean.hefty@intel.com>
 
 ---
 
-
+diff --git a/linux/acme_linux.c b/linux/acme_linux.c
+index 9477d29..1039645 100644
+--- a/linux/acme_linux.c
++++ b/linux/acme_linux.c
+@@ -53,7 +53,7 @@ get_pkey(struct ifreq *ifreq, uint16_t *pkey)
+       FILE *f;
+       int ret;
+-      sprintf(buf, "//sys//class//net//%s//pkey", ifreq->ifr_name);
++      snprintf(buf, sizeof buf, "//sys//class//net//%s//pkey", ifreq->ifr_name);
+       f = fopen(buf, "r");
+       if (!f) {
+               printf("failed to open %s\n", buf);
+@@ -79,7 +79,7 @@ get_sgid(struct ifreq *ifr, union ibv_gid *sgid)
+       FILE *f;
+       int i, p, ret;
+-      sprintf(buf, "//sys//class//net//%s//address", ifr->ifr_name);
++      snprintf(buf, sizeof buf, "//sys//class//net//%s//address", ifr->ifr_name);
+       f = fopen(buf, "r");
+       if (!f) {
+               printf("failed to open %s\n", buf);
+diff --git a/src/acm.c b/src/acm.c
+index 099e84e..376f294 100644
+--- a/src/acm.c
++++ b/src/acm.c
+@@ -268,7 +268,7 @@ acm_format_name(int level, char *name, size_t name_size,
+       case ACM_EP_INFO_PATH:
+               path = (struct ibv_path_record *) addr;
+               if (path->dlid) {
+-                      sprintf(name, "SLID(%u) DLID(%u)",
++                      snprintf(name, name_size, "SLID(%u) DLID(%u)",
+                               ntohs(path->slid), ntohs(path->dlid));
+               } else {
+                       acm_format_name(level, name, name_size, ACM_ADDRESS_GID,
+@@ -276,7 +276,7 @@ acm_format_name(int level, char *name, size_t name_size,
+               }
+               break;
+       case ACM_ADDRESS_LID:
+-              sprintf(name, "LID(%u)", ntohs(*((uint16_t *) addr)));
++              snprintf(name, name_size, "LID(%u)", ntohs(*((uint16_t *) addr)));
+               break;
+       default:
+               strcpy(name, "Unknown");
+@@ -3125,7 +3125,7 @@ static int acm_open_lock_file(void)
+               return -1;
+       }
+-      sprintf(pid, "%d\n", getpid());
++      snprintf(pid, sizeof pid, "%d\n", getpid());
+       write(lock_fd, pid, strlen(pid));
+       return 0;
+ }
+diff --git a/src/parse.c b/src/parse.c
+index 9a01afb..83ce843 100644
+--- a/src/parse.c
++++ b/src/parse.c
+@@ -52,7 +52,7 @@ static char *expand(char *basename, char *args, int *str_cnt, int *str_size)
+               }
+               while (from <= to) {
+-                      sprintf(buf, "%s%0*d", basename, width, from);
++                      snprintf(buf, sizeof buf, "%s%0*d", basename, width, from);
+                       str_buf = realloc(str_buf, size + strlen(buf)+1);
+                       strcpy(&str_buf[size], buf);