Skip to content

Commit

Permalink
fix zdb -R for raw flag
Browse files Browse the repository at this point in the history
Write was returing wrong size due to some non printable characters
in buffer So, I replaced Write with putchar.
  • Loading branch information
datacore-skumar committed Jan 19, 2021
1 parent c1864c4 commit fa1c330
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ZFSin/zfs/cmd/zdb/zdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -5059,9 +5059,11 @@ zdb_dump_gbh(void *buf, int flags)
static void
zdb_dump_block_raw(void *buf, uint64_t size, int flags)
{
unsigned char* str = buf;
if (flags & ZDB_FLAG_BSWAP)
byteswap_uint64_array(buf, size);
VERIFY(write(_fileno(stdout), buf, size) == size);
for (int i = 0; i < size; i++)
(void)putchar(str[i]);
}

static void
Expand Down

0 comments on commit fa1c330

Please sign in to comment.