aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2013-01-07 17:54:21 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2013-01-07 17:54:21 +0000
commitf51ec51f5b83372510c8da84eceeb898a7790892 (patch)
tree3f1fd3a7cd5428ac3ff2515f81aafed10e6b4ec5
parent5915919120e2e85685d565c4537238889d2d9ab7 (diff)
downloadsg3_utils-f51ec51f5b83372510c8da84eceeb898a7790892.tar.gz
sginfo, sg_inq + llseek.c: H. Reinecke small patches
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@473 6180dd3e-e324-4e3e-922d-17de1ae2f315
-rw-r--r--ChangeLog2
-rw-r--r--archive/llseek.c9
-rw-r--r--config.h.in3
-rwxr-xr-xconfigure11
-rw-r--r--configure.ac1
-rw-r--r--debian/changelog2
-rw-r--r--doc/sg_inq.84
-rw-r--r--sg3_utils.spec2
-rw-r--r--src/sg_inq.c11
-rw-r--r--src/sginfo.c10
10 files changed, 43 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index b44c0513..f85586e7 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.35 [20121221] [svn: r472]
+Changelog for sg3_utils-1.35 [20130107] [svn: r473]
- sg_compare_and_write: new utility
- sg_inq+sg_vpd: block device characteristics VPD page:
add product_type, WABEREQ, WACEREQ and VBULS fields
diff --git a/archive/llseek.c b/archive/llseek.c
index fbb0a5cc..fcc53faa 100644
--- a/archive/llseek.c
+++ b/archive/llseek.c
@@ -8,6 +8,9 @@
* of fdisk. It allows seeks to 64 bit offsets, if supported.
* Changed "ext2_" prefix to "llse".
*/
+
+#include "config.h"
+
#define _XOPEN_SOURCE 500
#define _GNU_SOURCE
@@ -31,7 +34,7 @@ extern llse_loff_t llse_llseek (unsigned int, llse_loff_t, unsigned int);
#else /* HAVE_LLSEEK */
-#if defined(__alpha__) || defined(__ia64__) || defined(__s390x__)
+#if defined(__alpha__) || defined(__ia64__) || defined(__s390x__) || defined (__x86_64__) || defined (__powerpc64__)
#define my_llseek lseek
@@ -65,10 +68,14 @@ static llse_loff_t my_llseek (unsigned int fd, llse_loff_t offset,
llse_loff_t result;
int retval;
+#ifdef HAVE_LSEEK64
+ return lseek64 (fd, offset, origin);
+#else
retval = _llseek (fd, ((uint64_t) offset) >> 32,
((uint64_t) offset) & 0xffffffff,
&result, origin);
return (retval == -1 ? (llse_loff_t) retval : result);
+#endif
}
#endif /* __alpha__ */
diff --git a/config.h.in b/config.h.in
index 3daaca2f..8d670563 100644
--- a/config.h.in
+++ b/config.h.in
@@ -18,6 +18,9 @@
/* Define to 1 if you have the <linux/types.h> header file. */
#undef HAVE_LINUX_TYPES_H
+/* Define to 1 if you have the `lseek64' function. */
+#undef HAVE_LSEEK64
+
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
diff --git a/configure b/configure
index b17e2a64..e2ee3077 100755
--- a/configure
+++ b/configure
@@ -11397,6 +11397,17 @@ _ACEOF
fi
done
+for ac_func in lseek64
+do :
+ ac_fn_c_check_func "$LINENO" "lseek64" "ac_cv_func_lseek64"
+if test "x$ac_cv_func_lseek64" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LSEEK64 1
+_ACEOF
+
+fi
+done
+
diff --git a/configure.ac b/configure.ac
index 24d24243..547c5367 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,6 +24,7 @@ AC_CHECK_FUNCS(getopt_long,
GETOPT_O_FILES='',
GETOPT_O_FILES='getopt_long.o')
AC_CHECK_FUNCS(posix_fadvise)
+AC_CHECK_FUNCS(lseek64)
AC_SUBST(GETOPT_O_FILES)
AC_CANONICAL_HOST
diff --git a/debian/changelog b/debian/changelog
index 15b2f38e..cb970230 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,7 +2,7 @@ sg3-utils (1.35-0.1) unstable; urgency=low
* New upstream version
- -- Douglas Gilbert <dgilbert@interlog.com> Thu, 20 Dec 2012 08:00:00 +1100
+ -- Douglas Gilbert <dgilbert@interlog.com> Mon, 07 Jan 2013 13:00:00 -0500
sg3-utils (1.34-0.1) unstable; urgency=low
diff --git a/doc/sg_inq.8 b/doc/sg_inq.8
index c1f163a5..eff3cbe5 100644
--- a/doc/sg_inq.8
+++ b/doc/sg_inq.8
@@ -1,4 +1,4 @@
-.TH SG_INQ "8" "November 2012" "sg3_utils\-1.35" SG3_UTILS
+.TH SG_INQ "8" "January 2013" "sg3_utils\-1.35" SG3_UTILS
.SH NAME
sg_inq \- issue SCSI INQUIRY command, output and decode response
.SH SYNOPSIS
@@ -365,7 +365,7 @@ Written by Douglas Gilbert
.SH "REPORTING BUGS"
Report bugs to <dgilbert at interlog dot com>.
.SH COPYRIGHT
-Copyright \(co 2001\-2012 Douglas Gilbert
+Copyright \(co 2001\-2013 Douglas Gilbert
.br
This software is distributed under the GPL version 2. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/sg3_utils.spec b/sg3_utils.spec
index 5ca719b2..f971438b 100644
--- a/sg3_utils.spec
+++ b/sg3_utils.spec
@@ -79,7 +79,7 @@ fi
%{_libdir}/*.la
%changelog
-* Thu Dec 20 2012 - dgilbert at interlog dot com
+* Mon Jan 07 2012 - dgilbert at interlog dot com
- track t10 changes, fix for cygwin 1.7.17
* sg3_utils-1.35
diff --git a/src/sg_inq.c b/src/sg_inq.c
index b62e3b4c..dd545120 100644
--- a/src/sg_inq.c
+++ b/src/sg_inq.c
@@ -1,5 +1,5 @@
/* A utility program originally written for the Linux OS SCSI subsystem.
-* Copyright (C) 2000-2012 D. Gilbert
+* Copyright (C) 2000-2013 D. Gilbert
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
@@ -66,7 +66,7 @@
* information [MAINTENANCE IN, service action = 0xc]; see sg_opcodes.
*/
-static char * version_str = "1.09 20121204"; /* SPC-4 rev 36 */
+static char * version_str = "1.10 20130107"; /* SPC-4 rev 36 */
/* Following VPD pages are in ascending page number order */
@@ -2303,10 +2303,17 @@ process_std_inq(int sg_fd, const struct opts_t * optsp)
printf(" Inquiry response length=%d, no vendor, "
"product or revision data\n", act_len);
else {
+ int i;
+
if (act_len < SAFE_STD_INQ_RESP_LEN)
rsp_buff[act_len] = '\0';
memcpy(xtra_buff, &rsp_buff[8], 8);
xtra_buff[8] = '\0';
+ /* Fixup any tab characters */
+ for (i = 0; i < 8; ++i) {
+ if (xtra_buff[i] == 0x09)
+ xtra_buff[i] = ' ';
+ }
printf(" Vendor identification: %s\n", xtra_buff);
if (act_len <= 16)
printf(" Product identification: <none>\n");
diff --git a/src/sginfo.c b/src/sginfo.c
index 4baae510..eb17888d 100644
--- a/src/sginfo.c
+++ b/src/sginfo.c
@@ -122,7 +122,7 @@
#define _GNU_SOURCE
#endif
-static const char * version_str = "2.30 [20121211]";
+static const char * version_str = "2.31 [20130107]";
#include <stdio.h>
#include <string.h>
@@ -3402,9 +3402,11 @@ show_devices(int raw)
if ( strncmp("sg",entry->d_name,2) == 0 ) {
continue;
}
- if ((strncmp("sd",entry->d_name,2) == 0) &&
- isdigit(entry->d_name[strlen(entry->d_name)-1])) {
- continue;
+ if ( strncmp("sd",entry->d_name,2) == 0 ) {
+ continue;
+ }
+ if ( isdigit(entry->d_name[strlen(entry->d_name)-1]) ) {
+ continue;
}
snprintf(dev_name, sizeof(dev_name),"/dev/%s",entry->d_name);