diff options
author | Bryan Cantrill <bryan@joyent.com> | 2013-04-11 17:43:26 +0000 |
---|---|---|
committer | Bryan Cantrill <bryan@joyent.com> | 2013-04-11 17:43:26 +0000 |
commit | 19aa17c54664f87374b494c7795457e9bd48e81a (patch) | |
tree | 66e93a07e71d78ef21b890c9c1da98400b839573 | |
parent | eea19e32536ac6153b616876645469dc5d765dbb (diff) | |
download | illumos-joyent-19aa17c54664f87374b494c7795457e9bd48e81a.tar.gz |
OS-2132 mdb_printf()'s "%H" must not use floating point under _KMDB
-rw-r--r-- | usr/src/cmd/mdb/common/mdb/mdb_io.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/usr/src/cmd/mdb/common/mdb/mdb_io.c b/usr/src/cmd/mdb/common/mdb/mdb_io.c index 4365b0a677..970de77540 100644 --- a/usr/src/cmd/mdb/common/mdb/mdb_io.c +++ b/usr/src/cmd/mdb/common/mdb/mdb_io.c @@ -915,12 +915,18 @@ iob_bytes2str(varglist_t *ap, intsize_t size) if (index == 0) { return (numtostr(n, 10, 0)); +#ifndef _KMDB } else if ((orig & ((1ULL << 10 * index) - 1)) == 0) { +#else + } else { +#endif /* - * If this is an even multiple of the base, always display - * without any decimal precision. + * If this is an even multiple of the base or we are in an + * environment where floating point is verboten (i.e., kmdb), + * always display without any decimal precision. */ (void) strcat(buf, numtostr(n, 10, 0)); +#ifndef _KMDB } else { /* * We want to choose a precision that results in the specified @@ -995,6 +1001,7 @@ iob_bytes2str(varglist_t *ap, intsize_t size) break; } } +#endif } c = &buf[strlen(buf)]; |