From: Sean Hefty Date: Tue, 29 May 2012 21:24:07 +0000 (-0700) Subject: refresh (create temporary patch) X-Git-Url: https://openfabrics.org/gitweb/?a=commitdiff_plain;h=1924ac78e5b355a8bcd72afab9209e0c948e2fe6;p=~shefty%2Flibrdmacm.git refresh (create temporary patch) --- diff --git a/meta b/meta index 651ae72c..8772cafe 100644 --- a/meta +++ b/meta @@ -1,6 +1,6 @@ Version: 1 -Previous: b4f552526cbf2383426c2a793a9c57b54fb8b60e -Head: 5511e1a1dd8add553da2b1fc35fce7dd0283012b +Previous: d9c09f8435c40e18f8754ca305e0de8cc4915315 +Head: ad3c061bb08a014018aa97973febc22440f13916 Applied: destroy_cqs: 66410c265b2661e16b7f6126bcc4ea5c7e1af1bd conn-err: ac46465ae6061b06f005ba9b49b371c9eb0d2325 @@ -17,6 +17,7 @@ Applied: rs-def-qpsize: 0fbd81e6a091a33b273e841b5c89414f52519adb rstream-bufsize: c6faa18bc246817c759475f4b44221555a4e892b rstream-snprint: 5511e1a1dd8add553da2b1fc35fce7dd0283012b + refresh-temp: ad3c061bb08a014018aa97973febc22440f13916 Unapplied: rstream-opt: 4921fc4c1bef460383296f5ac0436852b9d25828 rs-1sge: 85e4c4a0da0b501b60a1035d7a003ee20a749511 diff --git a/patches/refresh-temp b/patches/refresh-temp new file mode 100644 index 00000000..0eaab4d6 --- /dev/null +++ b/patches/refresh-temp @@ -0,0 +1,105 @@ +Bottom: fdfaeba03cd72a5fb2f57a5316f270c905d4dc15 +Top: 9fdb1c4ce072fef5c70660420a0d46c1004c5d7c +Author: Sean Hefty +Date: 2012-05-29 14:24:07 -0700 + +Refresh of rstream-snprint + +--- + +diff --git a/examples/rstream.c b/examples/rstream.c +index df36e34..83f9404 100644 +--- a/examples/rstream.c ++++ b/examples/rstream.c +@@ -82,7 +82,7 @@ static int iterations = 1; + static int transfer_size = 1000; + static int transfer_count = 1000; + static int buffer_size; +-static char test_name[9] = "custom"; ++static char test_name[10] = "custom"; + static char *port = "7471"; + static char *dst_addr; + static char *src_addr; +@@ -105,7 +105,7 @@ static void *buf; + #define rs_getsockopt(s,l,n,v,ol) \ + use_rs ? rgetsockopt(s,l,n,v,ol) : getsockopt(s,l,n,v,ol) + +-static void size_str(char *str, long long size) ++static void size_str(char *str, size_t ssize, long long size) + { + long long base, fraction = 0; + char mag; +@@ -127,22 +127,22 @@ static void size_str(char *str, long long size) + if (size / base < 10) + fraction = (size % base) * 10 / base; + if (fraction) { +- sprintf(str, "%lld.%lld%c", size / base, fraction, mag); ++ snprintf(str, ssize, "%lld.%lld%c", size / base, fraction, mag); + } else { +- sprintf(str, "%lld%c", size / base, mag); ++ snprintf(str, ssize, "%lld%c", size / base, mag); + } + } + +-static void cnt_str(char *str, long long cnt) ++static void cnt_str(char *str, size_t ssize, long long cnt) + { + if (cnt >= 1000000000) +- sprintf(str, "%lldb", cnt / 1000000000); ++ sprintf(str, ssize, "%lldb", cnt / 1000000000); + else if (cnt >= 1000000) +- sprintf(str, "%lldm", cnt / 1000000); ++ sprintf(str, ssize, "%lldm", cnt / 1000000); + else if (cnt >= 1000) +- sprintf(str, "%lldk", cnt / 1000); ++ sprintf(str, ssize, "%lldk", cnt / 1000); + else +- sprintf(str, "%lld", cnt); ++ sprintf(str, ssize, "%lld", cnt); + } + + static void show_perf(void) +@@ -156,13 +156,13 @@ static void show_perf(void) + + /* name size transfers iterations bytes seconds Gb/sec usec/xfer */ + printf("%-10s", test_name); +- size_str(str, transfer_size); ++ size_str(str, sizeof str, transfer_size); + printf("%-8s", str); +- cnt_str(str, transfer_count); ++ cnt_str(str, sizeof str, transfer_count); + printf("%-8s", str); +- cnt_str(str, iterations); ++ cnt_str(str, sizeof str, iterations); + printf("%-8s", str); +- size_str(str, bytes); ++ size_str(str, sizeof str, bytes); + printf("%-8s", str); + printf("%8.2fs%10.2f%11.2f\n", + usec / 1000000., (bytes * 8) / (1000. * usec), +@@ -185,8 +185,10 @@ static int size_to_count(int size) + + static void init_latency_test(int size) + { +- size_str(test_name, size); +- sprintf(test_name, "%s_lat", test_name); ++ char sstr[5]; ++ ++ size_str(sstr, sizeof sstr, size); ++ snprintf(test_name, sizeof test_name, "%s_lat", sstr); + transfer_count = 1; + transfer_size = size; + iterations = size_to_count(transfer_size); +@@ -194,8 +196,10 @@ static void init_latency_test(int size) + + static void init_bandwidth_test(int size) + { +- size_str(test_name, size); +- sprintf(test_name, "%s_bw", test_name); ++ char sstr[5]; ++ ++ size_str(sstr, sizeof sstr, size); ++ snprintf(test_name, sizeof test_name, "%s_bw", sstr); + iterations = 1; + transfer_size = size; + transfer_count = size_to_count(transfer_size);