From 27bf7335c8f4bf7b3eff1801892efc2bf9bcb3e7 Mon Sep 17 00:00:00 2001 From: Douglas Gilbert Date: Wed, 14 May 2008 13:57:35 +0000 Subject: sg_set_binary_mode() added for MinGW to stop LF to CR-LF conversion git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@170 6180dd3e-e324-4e3e-922d-17de1ae2f315 --- src/sg_luns.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/sg_luns.c') diff --git a/src/sg_luns.c b/src/sg_luns.c index a2d573a1..e2dd7c6b 100644 --- a/src/sg_luns.c +++ b/src/sg_luns.c @@ -48,7 +48,7 @@ * This program issues the SCSI command REPORT LUNS to the given SCSI device. */ -static char * version_str = "1.13 20080406"; +static char * version_str = "1.14 20080510"; #define MAX_RLUNS_BUFF_LEN (1024 * 64) #define DEF_RLUNS_BUFF_LEN MAX_RLUNS_BUFF_LEN @@ -312,6 +312,12 @@ main(int argc, char * argv[]) } if (0 == maxlen) maxlen = DEF_RLUNS_BUFF_LEN; + if (do_raw) { + if (sg_set_binary_mode(STDOUT_FILENO) < 0) { + perror("sg_set_binary_mode"); + return SG_LIB_FILE_ERROR; + } + } sg_fd = sg_cmds_open_device(device_name, 0 /* rw */, verbose); if (sg_fd < 0) { -- cgit v1.2.3