aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--README2
-rw-r--r--debian/changelog2
-rw-r--r--lib/Makefile.am1
-rw-r--r--lib/sg_pt_freebsd.c18
-rw-r--r--sg3_utils.spec2
-rw-r--r--src/Makefile.am1
-rw-r--r--src/sg_ses.c13
8 files changed, 30 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 6742924e..557c74ce 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,7 +2,7 @@ Each utility has its own version number, date of last change and
some description at the top of its ".c" file. All utilities in the main
directory have their own "man" pages. There is also a sg3_utils man page.
-Changelog for sg3_utils-1.37 [20130907] [svn: r512]
+Changelog for sg3_utils-1.37 [20130918] [svn: r513]
- sg_compare_and_write: fix wrprotect setting
- add --quiet option to suppress miscompare report
- merge features from another implementation
@@ -28,6 +28,7 @@ Changelog for sg3_utils-1.37 [20130907] [svn: r512]
- add dStrHexStr(): ascii hex to string
- add SG_LIB_CAT_MISCOMPARE to categories
- clean header files
+ - sg_pt_freebsd: sanity check on sense_resid
- scripts/rescan-scsi-bus.sh KG's v1.57 + HR patch
- improve wlun handling, detect updated and resized
devices, better multipath support
diff --git a/README b/README
index 35447841..43ebf69c 100644
--- a/README
+++ b/README
@@ -391,4 +391,4 @@ See http://sg.danny.cz/sg/tools.html
Douglas Gilbert
-7th September 2013
+17th September 2013
diff --git a/debian/changelog b/debian/changelog
index b5249b84..5fd3be5c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,7 +2,7 @@ sg3-utils (1.37-0.1) unstable; urgency=low
* New upstream version
- -- Douglas Gilbert <dgilbert@interlog.com> Sat, 07 Sep 2013 06:00:00 -0400
+ -- Douglas Gilbert <dgilbert@interlog.com> Tue, 17 Sep 2013 15:00:00 -0400
sg3-utils (1.36-0.1) unstable; urgency=low
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 9d4616b3..e5cadce8 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -37,6 +37,7 @@ endif
## CC = g++ -std=c++11
## CC = g++
## CC = clang
+## CC = clang++
# -std=<s> can be c99, c11, gnu11, etc. Default is gnu89 (gnu90 is the same)
AM_CFLAGS = -I ../include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -W
diff --git a/lib/sg_pt_freebsd.c b/lib/sg_pt_freebsd.c
index b78019da..cba8cc8f 100644
--- a/lib/sg_pt_freebsd.c
+++ b/lib/sg_pt_freebsd.c
@@ -1,11 +1,11 @@
/*
- * Copyright (c) 2005-2010 Douglas Gilbert.
+ * Copyright (c) 2005-2013 Douglas Gilbert.
* All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the BSD_LICENSE file.
*/
-/* sg_pt_freebsd version 1.10 20100321 */
+/* sg_pt_freebsd version 1.11 20130918 */
#include <stdio.h>
#include <stdlib.h>
@@ -393,8 +393,11 @@ do_scsi_pt(struct sg_pt_base * vp, int device_fd, int time_secs, int verbose)
if ((SAM_STAT_CHECK_CONDITION == ptp->scsi_status) ||
(SAM_STAT_COMMAND_TERMINATED == ptp->scsi_status)) {
- len = ptp->sense_len - ptp->sense_resid;
- if (len)
+ if (ptp->sense_resid > ptp->sense_len)
+ len = ptp->sense_len; /* crazy; ignore sense_resid */
+ else
+ len = ptp->sense_len - ptp->sense_resid;
+ if (len > 0)
memcpy(ptp->sense, &(ccb->csio.sense_data), len);
}
} else
@@ -442,10 +445,11 @@ int
get_scsi_pt_sense_len(const struct sg_pt_base * vp)
{
const struct sg_pt_freebsd_scsi * ptp = &vp->impl;
- int len;
- len = ptp->sense_len - ptp->sense_resid;
- return (len > 0) ? len : 0;
+ if (ptp->sense_resid > ptp->sense_len)
+ return ptp->sense_len; /* strange; ignore ptp->sense_resid */
+ else
+ return ptp->sense_len - ptp->sense_resid;
}
int
diff --git a/sg3_utils.spec b/sg3_utils.spec
index 19774329..58d45d35 100644
--- a/sg3_utils.spec
+++ b/sg3_utils.spec
@@ -79,7 +79,7 @@ fi
%{_libdir}/*.la
%changelog
-* Wed Aug 28 2013 - dgilbert at interlog dot com
+* Tue Sep 17 2013 - dgilbert at interlog dot com
- track t10 changes
* sg3_utils-1.37
diff --git a/src/Makefile.am b/src/Makefile.am
index da68e118..f76821c0 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -123,6 +123,7 @@ endif
## CC = g++ -std=c++11
## CC = g++
## CC = clang
+## CC = clang++
# -std=<s> can be c99, c11, gnu11, etc. Default is gnu89 (gnu90 is the same)
AM_CFLAGS = -I ../include -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -W
diff --git a/src/sg_ses.c b/src/sg_ses.c
index 8fddafb3..73d5c61f 100644
--- a/src/sg_ses.c
+++ b/src/sg_ses.c
@@ -27,7 +27,7 @@
* commands tailored for SES (enclosure) devices.
*/
-static const char * version_str = "1.74 20130907"; /* ses3r06 */
+static const char * version_str = "1.75 20130917"; /* ses3r06 */
#define MX_ALLOC_LEN ((64 * 1024) - 1)
#define MX_ELEM_HDR 1024
@@ -212,10 +212,21 @@ static struct type_desc_hdr_t type_desc_hdr_arr[MX_ELEM_HDR];
static struct join_row_t join_arr[MX_JOIN_ROWS];
static struct join_row_t * join_arr_lastp = join_arr + MX_JOIN_ROWS - 1;
+#ifdef SG_LIB_FREEBSD
+static unsigned char enc_stat_rsp[MX_ALLOC_LEN]
+ __attribute__ ((aligned (4096)));
+static unsigned char elem_desc_rsp[MX_ALLOC_LEN]
+ __attribute__ ((aligned (4096)));
+static unsigned char add_elem_rsp[MX_ALLOC_LEN]
+ __attribute__ ((aligned (4096)));
+static unsigned char threshold_rsp[MX_ALLOC_LEN]
+ __attribute__ ((aligned (4096)));
+#else
static unsigned char enc_stat_rsp[MX_ALLOC_LEN];
static unsigned char elem_desc_rsp[MX_ALLOC_LEN];
static unsigned char add_elem_rsp[MX_ALLOC_LEN];
static unsigned char threshold_rsp[MX_ALLOC_LEN];
+#endif
static int enc_stat_rsp_len;
static int elem_desc_rsp_len;
static int add_elem_rsp_len;