diff mbox

ibsim/sim_cmd.c: Add ULLONG_MAX if not defined

Message ID 1429683713-19991-1-git-send-email-ilyan@dev.mellanox.co.il (mailing list archive)
State Accepted
Delegated to: Hal Rosenstock
Headers show

Commit Message

Ilya Nelkenbaum April 22, 2015, 6:21 a.m. UTC
From: Ilya Nelkenbaum <ilyan@mellanox.com>

In old glibc versions (< 2.9.90) it is not defined

Signed-off-by: Ilya Nelkenbaum <ilyan@mellanox.com>
---
 ibsim/sim_cmd.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Hal Rosenstock April 22, 2015, 11:49 a.m. UTC | #1
On 4/22/2015 2:21 AM, Ilya Nelkenbaum wrote:
> From: Ilya Nelkenbaum <ilyan@mellanox.com>
> 
> In old glibc versions (< 2.9.90) it is not defined
> 
> Signed-off-by: Ilya Nelkenbaum <ilyan@mellanox.com>

Thanks. Applied.

-- Hal
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/ibsim/sim_cmd.c b/ibsim/sim_cmd.c
index 4822a0b..249228a 100644
--- a/ibsim/sim_cmd.c
+++ b/ibsim/sim_cmd.c
@@ -934,6 +934,11 @@  static int do_perf_counter_set(FILE *f, char *line)
 		field_trim--;
 	*(field_trim + 1) = 0;
 
+#ifndef ULLONG_MAX
+/* Maximum value an `unsigned long long int' can hold. (Minimum is 0.) */
+#   define ULLONG_MAX   18446744073709551615ULL
+#endif
+
 	errno = 0;
 	value = strtoull(s, &val_error, 0);
 	if((value == 0 || value == ULLONG_MAX) && errno != 0) {