aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2009-07-22 19:58:40 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2009-07-22 19:58:40 +0000
commit0155b1c6df4bf16ac2f03c571352132f6a11f6b9 (patch)
tree000a878a8f640059d48418716f6c392ef942e402
parent017aa7827624e209683c4376074d598ed518e915 (diff)
downloadsg3_utils-0155b1c6df4bf16ac2f03c571352132f6a11f6b9.tar.gz
rest of '%#x' changes; incorporate debian SID patch
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@282 6180dd3e-e324-4e3e-922d-17de1ae2f315
-rw-r--r--ChangeLog4
-rw-r--r--README2
-rw-r--r--debian/changelog62
-rw-r--r--debian/compat1
-rw-r--r--debian/control89
-rw-r--r--debian/copyright16
-rw-r--r--debian/docs6
-rw-r--r--debian/libsgutils2-2.install1
-rw-r--r--debian/libsgutils2-dev.install1
-rwxr-xr-xdebian/rules14
-rw-r--r--doc/sg_ident.86
-rw-r--r--include/sg_io_linux.h7
-rw-r--r--lib/sg_cmds_extra.c8
-rw-r--r--lib/sg_cmds_mmc.c8
-rw-r--r--lib/sg_io_linux.c6
-rw-r--r--lib/sg_lib.c58
-rw-r--r--lib/sg_lib_data.c2
-rw-r--r--lib/sg_pt_linux.c18
-rw-r--r--lib/sg_pt_solaris.c4
-rw-r--r--sg3_utils.spec2
-rw-r--r--utils/sg_chk_asc.c6
21 files changed, 146 insertions, 175 deletions
diff --git a/ChangeLog b/ChangeLog
index 608b0ab5..46f94dd2 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.28 [20090622] [svn: r279]
+Changelog for sg3_utils-1.28 [20090722] [svn: r282]
- sg_unmap: new utility for thin provisioning
- add examples/sg_unmap_example.txt
- sg_read_block_limits: new utility for tape drives
@@ -26,6 +26,8 @@ Changelog for sg3_utils-1.28 [20090622] [svn: r279]
binary mode on read files
- sg_pt_win32: define WIN32_SPT_DIRECT (was SPTD) via config.h
has been using indirect accidentally since version 1.26
+ - change most "0x%x" printf format strings to "%#x"
+ - debian: incorporate patch from debian sid
Changelog for sg3_utils-1.27 [20090411] [svn: r250]
- sg_write_same: new utility: 10, 16 and 32 byte cdb variants
diff --git a/README b/README
index f4112b90..a5de7020 100644
--- a/README
+++ b/README
@@ -338,4 +338,4 @@ See http://sg.danny.cz/sg/tools.html
Doug Gilbert
-22nd June 2009
+17th July 2009
diff --git a/debian/changelog b/debian/changelog
index 21debdc0..2841a41a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,25 +2,54 @@ sg3-utils (1.28-0.1) unstable; urgency=low
* New upstream version
- -- Doug Gilbert <dgilbert@interlog.com> Mon, 22 Jun 2009 14:00:00 -0400
+ -- Doug Gilbert <dgilbert@interlog.com> Wed, 22 Jul 2009 12:30:00 -0400
sg3-utils (1.27-0.1) unstable; urgency=low
- * New upstream version
-
- -- Doug Gilbert <dgilbert@interlog.com> Sat, 11 Apr 2009 10:30:00 -0400
-
-sg3-utils (1.26-0.1) unstable; urgency=low
-
- * New upstream version
-
- -- Doug Gilbert <dgilbert@interlog.com> Wed, 25 Jun 2008 15:00:00 -0400
-
-sg3-utils (1.25-0.1) unstable; urgency=low
-
- * New upstream version
-
- -- Doug Gilbert <dgilbert@interlog.com> Tue, 16 Oct 2007 10:00:00 -0400
+ [ Martin Pitt ]
+ * Non-maintainer upload; this package blocks DeviceKit, and maintainer is
+ apparently not active any more. Also clean up and modernize the package
+ somewhat while we are at it.
+ * New upstream release (required for current devicekit-disks).
+ (Closes: #532546). Upstream original tarball repacked to not contain
+ debian/ directory.
+ * Rename libsgutils1{,-dev} to libsgutils2-2{,-dev}, upstream bumped SONAME.
+ Also call the library libgsutils2-2 to match SONAME. Add
+ Conflicts/Replaces for "libsgutils2" to provide a clean upgrade from the
+ packages as provided by Upstream and Ubuntu.
+ * debian/rules: Update build rules for upstream Makefile → autotools switch.
+ * debian/rules: Fix cleaning a clean source package.
+ * Demote Recommends to Suggests; the library doesn't actually call the
+ binaries in sg3-utils. (Closes: #532547)
+ * Drop debian/*.dirs, unnecessary with dh_install.
+ * Drop sg3-utils.preinst, not necessary to deal with kernel 2.4 any more.
+ * Drop libsgutils2-0.install, libsgutils2-0-dev.install, these packages
+ don't exist.
+ * Drop libsgutils2.post{inst,rm}: Basically empty, debhelper will create its
+ own.
+ * libsgutils2-dev.install: Drop *.lo.
+ * debian/compat: 4 -> 7. Bump debhelper build-depends accordingly.
+ * debian/control: Bump Standards-Version to 3.8.2.
+ * debian/control: Modernize package description for Linux 2.6.
+ (Closes: #506578)
+ * debian/rules: Drop -k argument from dh_clean (thanks lintian).
+
+ [ Frank Lichtenheld ]
+ * debian/control, debian/rules: Add dependency of libsgutils-dev on
+ libcam-dev on kfreebsd-*. (Closes: #519460)
+
+ -- Martin Pitt <mpitt@debian.org> Mon, 22 Jun 2009 12:04:20 +0200
+
+sg3-utils (1.24-2) unstable; urgency=low
+
+ * Cleaned up package description (Closes: #445920).
+ * Don't make libtool think rpath is necessary (Closes: #451153)
+ * Capitalized Linux in extended description (Closes: #457526).
+ * Completed sentence in libsgutils1 long description (Closes: #421391).
+ * Added patch from Aurelian Jarno to build on kfreebsd-* (Closes: #455430).
+ * Symlinks in examples directory cleaned up (Closes: #372610).
+
+ -- Eric Schwartz (Skif) <emschwar@debian.org> Sun, 30 Dec 2007 11:52:58 -0700
sg3-utils (1.24-1) unstable; urgency=low
@@ -127,4 +156,3 @@ sg3-utils (0.95-1) unstable; urgency=low
-- Eric Schwartz <emschwar@debian.org> Wed, 14 Nov 2001 17:05:56 -0700
-
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 00000000..7f8f011e
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/debian/control b/debian/control
index 66192966..8807e63a 100644
--- a/debian/control
+++ b/debian/control
@@ -2,91 +2,30 @@ Source: sg3-utils
Section: admin
Priority: optional
Maintainer: Eric Schwartz (Skif) <emschwar@debian.org>
-Build-Depends: debhelper (>> 4.0.0), chrpath, libtool
-Standards-Version: 3.7.2
+Build-Depends: debhelper (>> 7), libtool, libcam-dev [kfreebsd-i386 kfreebsd-amd64]
+Standards-Version: 3.8.2
Package: sg3-utils
Architecture: any
Depends: ${shlibs:Depends}
Conflicts: sg-utils, cdwrite
Replaces: sg-utils
-Description: collection of Linux utilities for devices that use the
- SCSI command set. See the README, ChangeLog and COVERAGE files.
- .
- Requires the linux kernel 2.4 series or later. In the 2.4 series
- SCSI generic device names (e.g. /dev/sg0) must be used. In the 2.6
- series other device names may be used as well (e.g. /dev/sda).
- .
- The package includes:
- * sg_dd - a variant of 'dd' that works at the SCSI command level
- * sg_emc_trespass - vendor specific for Clariion hardware
- * sg_format - format SCSI disks
- * sg_get_config - get features and profiles of MMC devices
- * sg_ident - report and set device identifiers
- * sginfo - a re-porting of the 'scsiinfo' program, updated
- * sg_inq - a utility for poking around with the SCSI INQUIRY command
- * sg_logs - prints out log sense pages
- * sg_luns - prints out REPORT LUNS response
- * sg_map - shows the mapping between SCSI devices and sg devices
- * sg_map26 - map primary device node to generic node (lk 2.6 only)
- * sgm_dd - like sg_dd, but uses mmap()'d IO
- * sg_modes - prints out mode sense pages
- * sg_opcodes - reports supported opcodes and task management fcns
- * sgp_dd - like sg_dd, only multithreaded
- * sg_persist - accesses the Persistent Reservation In and Out commands
- * sg_prevent - issues PREVENT ALLOW MEDIUM REMOVAL command (MMC + SSC)
- * sg_raw - send arbitrary SCSI commands
- * sg_rbuf - tests SCSI bus speed
- * sg_rdac - vendor specific for RDAC hardware
- * sg_read - reads multiple blocks, useful for timing
- * sg_read_block_limits - READ BLOCK LIMITS (SSC)
- * sg_read_buffer - READ BUFFER
- * sg_read_long - read a "long" block from the given device
- * sg_readcap - prints the output of a READ CAPACITY command
- * sg_reassign - issues a REASSIGN BLOCKS command (map out bad sectors)
- * sg_requests - issues a REQUEST SENSE command (event polling)
- * sg_reset - exercises SCSI device/bus/host reset capability
- * sg_rmsn - READ SERIAL SERIAL NUMBER
- * sg_rtpg - REPORT TARGET PORT GROUPS
- * sg_safte - fetch enclosure status from a SAF-TE processor
- * sg_sat_identify - ATA IDENTIFY (PACKET) DEVICE via SATL
- * sg_sat_phy_event - show SATA phy event counters via SATL
- * sg_sat_set_features - ATA SET FEATURES via SATL
- * sg_scan - displays the SCSI bus on stdout
- * sg_senddiag - runs SCSI self tests
- * sg_ses - fetches status and send control to a SES device
- * sg_start - spins up (or down) disks and optical drives
- * sg_stpg - SET TARGET PORT GROUPS
- * sg_sync - issues a SYNCHRONIZE CACHE command
- * sg_test_rwbuf - tests the SCSI host adapter
- * sg_turs - execute a TEST UNIT READY command on the given device
- * sg_unmap - issues UNMAP to unmap one or more logical blocks
- * sg_verify - issues VERIFY command on SCSI disks
- * sg_vpd - utility for decoding VPD pages
- * sg_write_buffer - WRITE BUFFER, may be used to load firmware
- * sg_write_long - write a "long" block to the given device
- * sg_write_same - write a block to one or more consecutive LBAs
- * sg_wr_mode - low level utility to change mode pages
- .
- It also includes source code for some example programs that demonstrate
- how to use the scsi generic driver.
+Description: utilities for devices using the SCSI command set.
-Package: libsgutils2
+Package: libsgutils2-2
Section: libs
Depends: ${shlibs:Depends}
-Conflicts: libsgutils-1-0
Architecture: any
-Recommends: sg3-utils
-Description: utilities for working with generic SCSI devices (shared libraries)
- This package contains the shared libraries that allow other programs to use it.
+Conflicts: libsgutils2
+Replaces: libsgutils2
+Suggests: sg3-utils
+Description: utilities for devices using the SCSI command set (shared libraries)
Package: libsgutils2-dev
-Section: devel
+Section: libdevel
Architecture: any
-Depends: libsgutils2, ${shlibs:Depends}
-Recommends: sg3-utils
-Description: utilities for working with generic SCSI devices (developer files)
- This package contains the <scsi/sg_cmds.h> , <scsi/sg_cmds_basic.h> ,
- <scsi/sg_cmds_extra.h> , <scsi/sg_lib.h> , <scsi/sg_linux_inc.h> and
- <scsi/sg_io_linux.h> header files, the /usr/lib/libsgutils.a static library
- plus other assorted development tidbits.
+Depends: libsgutils2-2 (= ${binary:Version}), ${shlibs:Depends}, ${kfreebsd:Depends}
+Conflicts: libsgutils1-dev
+Suggests: sg3-utils
+Description: utilities for devices using the SCSI command set (developer files)
+
diff --git a/debian/copyright b/debian/copyright
index 1385eb4f..10ebeaf3 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -16,18 +16,18 @@ Upstream Authors: Douglas Gilbert <dgilbert at interlog dot com>,
Copyright:
-This software is copyright(c) 1994-2007 by the authors
+This software is copyright(c) 1994-2009 by the authors
You are free to distribute this software under the terms of
the GNU General Public License.
On Debian systems, the complete text of the GNU General Public
License can be found in /usr/share/common-licenses/GPL file.
-Some parts of this package are covered by the BSD license.
-These include central error processing code (sg_lib.[hc]),
-common command code (sg_cmds_basic.[hc] and sg_cmds_extra.[hc])
-and later utilities. They are Copyright: Douglas Gilbert.
-The author's intention is that this code can be used freely
-by others. On Debian systems, the complete text of the BSD
-License can be found in /usr/share/common-licenses/BSD.
+Many parts of this package are covered by the BSD license.
+These include central error processing code and common command
+code found in the lib subdirectory. Most newer utilities also
+use the BSD license. The author's intention is that this code can
+be used freely by others. On Debian systems and those derived from
+Debian, the complete text of the BSD License can be found in
+/usr/share/common-licenses/BSD.
diff --git a/debian/docs b/debian/docs
index c3cf60a2..2df5468b 100644
--- a/debian/docs
+++ b/debian/docs
@@ -1,10 +1,8 @@
+README
+README.sg_start
AUTHORS
ChangeLog
COVERAGE
CREDITS
INSTALL
NEWS
-README
-README.sg_start
-doc/README
-TODO
diff --git a/debian/libsgutils2-2.install b/debian/libsgutils2-2.install
new file mode 100644
index 00000000..093956b1
--- /dev/null
+++ b/debian/libsgutils2-2.install
@@ -0,0 +1 @@
+usr/lib/*.so.*
diff --git a/debian/libsgutils2-dev.install b/debian/libsgutils2-dev.install
index b2320a06..5d09f30f 100644
--- a/debian/libsgutils2-dev.install
+++ b/debian/libsgutils2-dev.install
@@ -1,5 +1,4 @@
usr/include/scsi
usr/lib/*.so
-usr/lib/*.lo
usr/lib/*.la
usr/lib/*.a
diff --git a/debian/rules b/debian/rules
index 95a6add6..5f27f1b5 100755
--- a/debian/rules
+++ b/debian/rules
@@ -9,15 +9,13 @@
# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1
-# Debhelper compatibility level
-export DH_COMPAT=4
+DEB_HOST_ARCH_OS := $(shell dpkg-architecture -qDEB_HOST_ARCH_OS 2>/dev/null)
configure: configure-stamp
configure-stamp:
dh_testdir
# Add here commands to configure the package.
CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --bindir=/usr/bin --prefix=/usr --mandir=\$${prefix}/share/man
-
touch configure-stamp
build: configure-stamp build-stamp
@@ -34,7 +32,7 @@ clean:
dh_testroot
# Add here commands to clean up after the build process.
- -$(MAKE) clean
+ -$(MAKE) distclean
rm -f build-stamp configure-stamp debian/substvars
@@ -44,14 +42,15 @@ install: DH_OPTIONS=
install: build
dh_testdir
dh_testroot
- dh_clean -k
+ dh_clean
dh_installdirs
# Add here commands to install the package into debian/tmp
$(MAKE) -e install DESTDIR=$(CURDIR)/debian/tmp PREFIX=/usr
- find debian/tmp/usr/bin debian/tmp/usr/lib -type f -exec chrpath -d {} \;
dh_install --autodest --sourcedir=debian/tmp
+ cp scripts/scsi* scripts/sas* debian/sg3-utils/usr/bin
+
dh_installman
# Build architecture-independent files here.
@@ -73,6 +72,9 @@ binary-arch: build install
dh_fixperms -a
dh_makeshlibs -V -v
dh_installdeb -a
+ifeq ($(DEB_HOST_ARCH_OS),kfreebsd)
+ echo kfreebsd:Depends=libcam-dev >>debian/libsgutils2-dev.substvars
+endif
dh_shlibdeps -ldebian/tmp/usr/lib -L libsgutils2
dh_gencontrol -a
dh_md5sums -a
diff --git a/doc/sg_ident.8 b/doc/sg_ident.8
index a6dcee6d..11cba82f 100644
--- a/doc/sg_ident.8
+++ b/doc/sg_ident.8
@@ -1,4 +1,4 @@
-.TH SG_IDENT "8" "January 2007" "sg3_utils\-1.23" SG3_UTILS
+.TH SG_IDENT "8" "July 2009" "sg3_utils\-1.28" SG3_UTILS
.SH NAME
sg_ident \- sends a SCSI REPORT or SET IDENTIFYING INFORMATION command
.SH SYNOPSIS
@@ -10,7 +10,7 @@ sg_ident \- sends a SCSI REPORT or SET IDENTIFYING INFORMATION command
.\" Add any additional description here
.PP
Send a SCSI REPORT IDENTIFYING INFORMATION or SET IDENTIFYING INFORMATION
-command to \fIDEVICE\fR. Prior to SPC\-4 (revison 7) these
+command to \fIDEVICE\fR. Prior to SPC\-4 (revision 7) these
commands were called REPORT DEVICE IDENTIFIER and SET DEVICE IDENTIFIER
respectively. SCSI devices that support these two commands allow users
to write (set) identifying information and report it back at some
@@ -111,7 +111,7 @@ Written by Douglas Gilbert.
.SH "REPORTING BUGS"
Report bugs to <dgilbert at interlog dot com>.
.SH COPYRIGHT
-Copyright \(co 2005\-2007 Douglas Gilbert
+Copyright \(co 2005\-2009 Douglas Gilbert
.br
This software is distributed under a FreeBSD license. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
diff --git a/include/sg_io_linux.h b/include/sg_io_linux.h
index 9bdd34b3..7e30ace1 100644
--- a/include/sg_io_linux.h
+++ b/include/sg_io_linux.h
@@ -2,7 +2,7 @@
#define SG_IO_LINUX_H
/*
- * Copyright (c) 2004-2005 Douglas Gilbert.
+ * Copyright (c) 2004-2009 Douglas Gilbert.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -31,7 +31,7 @@
*/
/*
- * Version 1.02 [20070121]
+ * Version 1.02 [20090708]
*/
/*
@@ -142,7 +142,8 @@ extern void sg_print_driver_status(int driver_status);
/* sg_chk_n_print() returns 1 quietly if there are no errors/warnings
else it prints errors/warnings (prefixed by 'leadin') to
- 'sg_warnings_fd' and returns 0. */
+ 'sg_warnings_fd' and returns 0. raw_sinfo indicates whether the
+ raw sense buffer (in ASCII hex) should be printed. */
extern int sg_chk_n_print(const char * leadin, int masked_status,
int host_status, int driver_status,
const unsigned char * sense_buffer, int sb_len,
diff --git a/lib/sg_cmds_extra.c b/lib/sg_cmds_extra.c
index e6eb720b..f2e45999 100644
--- a/lib/sg_cmds_extra.c
+++ b/lib/sg_cmds_extra.c
@@ -1054,7 +1054,7 @@ sg_ll_read_long10(int sg_fd, int pblock, int correct, unsigned int lba,
ret = SG_LIB_CAT_ILLEGAL_REQ_WITH_INFO;
} else {
if (verbose > 1)
- fprintf(sg_warnings_strm, " info field: 0x%" PRIx64
+ fprintf(sg_warnings_strm, " info field: %#" PRIx64
", valid: %d, ili: %d\n", ull, valid, ili);
ret = SG_LIB_CAT_ILLEGAL_REQ;
}
@@ -1153,7 +1153,7 @@ sg_ll_read_long16(int sg_fd, int pblock, int correct, uint64_t llba,
ret = SG_LIB_CAT_ILLEGAL_REQ_WITH_INFO;
} else {
if (verbose > 1)
- fprintf(sg_warnings_strm, " info field: 0x%" PRIx64
+ fprintf(sg_warnings_strm, " info field: %#" PRIx64
", valid: %d, ili: %d\n", ull, valid, ili);
ret = SG_LIB_CAT_ILLEGAL_REQ;
}
@@ -1250,7 +1250,7 @@ sg_ll_write_long10(int sg_fd, int cor_dis, int wr_uncor, int pblock,
ret = SG_LIB_CAT_ILLEGAL_REQ_WITH_INFO;
} else {
if (verbose > 1)
- fprintf(sg_warnings_strm, " info field: 0x%" PRIx64
+ fprintf(sg_warnings_strm, " info field: %#" PRIx64
", valid: %d, ili: %d\n", ull, valid, ili);
ret = SG_LIB_CAT_ILLEGAL_REQ;
}
@@ -1353,7 +1353,7 @@ sg_ll_write_long16(int sg_fd, int cor_dis, int wr_uncor, int pblock,
ret = SG_LIB_CAT_ILLEGAL_REQ_WITH_INFO;
} else {
if (verbose > 1)
- fprintf(sg_warnings_strm, " info field: 0x%" PRIx64
+ fprintf(sg_warnings_strm, " info field: %#" PRIx64
", valid: %d, ili: %d\n", ull, valid, ili);
ret = SG_LIB_CAT_ILLEGAL_REQ;
}
diff --git a/lib/sg_cmds_mmc.c b/lib/sg_cmds_mmc.c
index 71bae58f..f63320ca 100644
--- a/lib/sg_cmds_mmc.c
+++ b/lib/sg_cmds_mmc.c
@@ -145,14 +145,14 @@ sg_ll_get_config(int sg_fd, int rt, int starting, void * resp,
}
gcCmdBlk[1] = (rt & 0x3);
if ((starting < 0) || (starting > 0xffff)) {
- fprintf(sg_warnings_strm, "Bad starting field number: 0x%x\n",
+ fprintf(sg_warnings_strm, "Bad starting field number: %#x\n",
starting);
return -1;
}
gcCmdBlk[2] = (unsigned char)((starting >> 8) & 0xff);
gcCmdBlk[3] = (unsigned char)(starting & 0xff);
if ((mx_resp_len < 0) || (mx_resp_len > 0xffff)) {
- fprintf(sg_warnings_strm, "Bad mx_resp_len: 0x%x\n", starting);
+ fprintf(sg_warnings_strm, "Bad mx_resp_len: %#x\n", starting);
return -1;
}
gcCmdBlk[7] = (unsigned char)((mx_resp_len >> 8) & 0xff);
@@ -242,13 +242,13 @@ sg_ll_get_performance(int sg_fd, int data_type, unsigned int starting_lba,
gpCmdBlk[4] = (unsigned char)((starting_lba >> 8) & 0xff);
gpCmdBlk[3] = (unsigned char)(starting_lba & 0xff);
if ((max_num_desc < 0) || (max_num_desc > 0xffff)) {
- fprintf(sg_warnings_strm, "Bad max_num_desc: 0x%x\n", max_num_desc);
+ fprintf(sg_warnings_strm, "Bad max_num_desc: %#x\n", max_num_desc);
return -1;
}
gpCmdBlk[8] = (unsigned char)((max_num_desc >> 8) & 0xff);
gpCmdBlk[9] = (unsigned char)(max_num_desc & 0xff);
if ((ttype < 0) || (ttype > 0xff)) {
- fprintf(sg_warnings_strm, "Bad type: 0x%x\n", ttype);
+ fprintf(sg_warnings_strm, "Bad type: %#x\n", ttype);
return -1;
}
gpCmdBlk[10] = (unsigned char)ttype;
diff --git a/lib/sg_io_linux.c b/lib/sg_io_linux.c
index 93a5efb3..b4364d42 100644
--- a/lib/sg_io_linux.c
+++ b/lib/sg_io_linux.c
@@ -43,7 +43,7 @@
#include "sg_io_linux.h"
-/* Version 1.03 20090422 */
+/* Version 1.03 20090716 */
void
@@ -69,7 +69,7 @@ sg_print_host_status(int host_status)
{
if (NULL == sg_warnings_strm)
sg_warnings_strm = stderr;
- fprintf(sg_warnings_strm, "Host_status=0x%02x ", host_status);
+ fprintf(sg_warnings_strm, "Host_status=%#02x ", host_status);
if ((host_status < 0) || (host_status >= LINUX_HOST_BYTES_SZ))
fprintf(sg_warnings_strm, "is invalid ");
else
@@ -110,7 +110,7 @@ sg_print_driver_status(int driver_status)
sugg_cp = linux_driver_suggests[sugg];
if (NULL == sg_warnings_strm)
sg_warnings_strm = stderr;
- fprintf(sg_warnings_strm, "Driver_status=0x%02x", driver_status);
+ fprintf(sg_warnings_strm, "Driver_status=%#02x", driver_status);
fprintf(sg_warnings_strm, " [%s, %s] ", driv_cp, sugg_cp);
}
diff --git a/lib/sg_lib.c b/lib/sg_lib.c
index 52ea2811..773c563b 100644
--- a/lib/sg_lib.c
+++ b/lib/sg_lib.c
@@ -179,7 +179,7 @@ sg_get_sense_key_str(int sense_key, int buff_len, char * buff)
if ((sense_key >= 0) && (sense_key < 16))
snprintf(buff, buff_len, "%s", sg_lib_sense_key_desc[sense_key]);
else
- snprintf(buff, buff_len, "invalid value: 0x%x", sense_key);
+ snprintf(buff, buff_len, "invalid value: %#x", sense_key);
return buff;
}
@@ -466,7 +466,7 @@ sg_get_sense_descriptors_str(const unsigned char * sense_buffer, int sb_len,
processed = 0;
break;
}
- n += sprintf(b + n, " 0x%02x%02x\n", descp[5],
+ n += sprintf(b + n, " %#02x%02x\n", descp[5],
descp[6]);
break;
case SPC_SK_NO_SENSE:
@@ -502,7 +502,7 @@ sg_get_sense_descriptors_str(const unsigned char * sense_buffer, int sb_len,
!!(descp[4] & 0x1));
break;
default:
- n += sprintf(b + n, " Sense_key: 0x%x unexpected\n",
+ n += sprintf(b + n, " Sense_key: %#x unexpected\n",
sense_key);
processed = 0;
break;
@@ -511,7 +511,7 @@ sg_get_sense_descriptors_str(const unsigned char * sense_buffer, int sb_len,
case 3:
n += sprintf(b + n, "Field replaceable unit\n");
if (add_len >= 2)
- n += sprintf(b + n, " code=0x%x\n", descp[3]);
+ n += sprintf(b + n, " code=%#x\n", descp[3]);
else
processed = 0;
break;
@@ -556,23 +556,23 @@ sg_get_sense_descriptors_str(const unsigned char * sense_buffer, int sb_len,
extended = descp[2] & 1;
sector_count = descp[5] + (extended ? (descp[4] << 8) : 0);
- n += sprintf(b + n, " extended=%d error=0x%x "
- " sector_count=0x%x\n", extended, descp[3],
+ n += sprintf(b + n, " extended=%d error=%#x "
+ " sector_count=%#x\n", extended, descp[3],
sector_count);
if (extended)
- n += sprintf(b + n, " lba=0x%02x%02x%02x%02x%02x%02x\n",
+ n += sprintf(b + n, " lba=%#02x%02x%02x%02x%02x%02x\n",
descp[10], descp[8], descp[6],
descp[11], descp[9], descp[7]);
else
- n += sprintf(b + n, " lba=0x%02x%02x%02x\n",
+ n += sprintf(b + n, " lba=%#02x%02x%02x\n",
descp[11], descp[9], descp[7]);
- n += sprintf(b + n, " device=0x%x status=0x%x\n",
+ n += sprintf(b + n, " device=%#x status=%#x\n",
descp[12], descp[13]);
} else
processed = 0;
break;
default:
- n += sprintf(b + n, "Unknown or vendor specific [0x%x]\n",
+ n += sprintf(b + n, "Unknown or vendor specific [%#x]\n",
descp[0]);
processed = 0;
break;
@@ -657,7 +657,7 @@ sg_get_sense_str(const char * leadin, const unsigned char * sense_buffer,
break;
default:
snprintf(error_buff, sizeof(error_buff),
- "Unknown response code: 0x%x", ssh.response_code);
+ "Unknown response code: %#x", ssh.response_code);
error = error_buff;
break;
}
@@ -691,10 +691,10 @@ sg_get_sense_str(const char * leadin, const unsigned char * sense_buffer,
(sense_buffer[4] << 16) | (sense_buffer[5] << 8) |
sense_buffer[6]);
if (valid)
- r += sprintf(b + r, " Info fld=0x%x [%u] ", info,
+ r += sprintf(b + r, " Info fld=%#x [%u] ", info,
info);
else if (info > 0)
- r += sprintf(b + r, " Valid=0, Info fld=0x%x [%u] ",
+ r += sprintf(b + r, " Valid=0, Info fld=%#x [%u] ",
info, info);
} else
info = 0;
@@ -738,7 +738,7 @@ sg_get_sense_str(const char * leadin, const unsigned char * sense_buffer,
case SPC_SK_MEDIUM_ERROR:
case SPC_SK_RECOVERED_ERROR:
r += sprintf(b + r, " Actual retry count: "
- "0x%02x%02x\n", sense_buffer[16],
+ "%#02x%02x\n", sense_buffer[16],
sense_buffer[17]);
break;
case SPC_SK_COPY_ABORTED:
@@ -759,7 +759,7 @@ sg_get_sense_str(const char * leadin, const unsigned char * sense_buffer,
!!(sense_buffer[15] & 0x1));
break;
default:
- r += sprintf(b + r, " Sense_key: 0x%x unexpected\n",
+ r += sprintf(b + r, " Sense_key: %#x unexpected\n",
ssh.sense_key);
break;
}
@@ -789,7 +789,7 @@ sg_get_sense_str(const char * leadin, const unsigned char * sense_buffer,
((sense_buffer[0] >> 4) & 0x7),
(sense_buffer[0] & 0xf));
if (sense_buffer[0] & 0x80)
- r += sprintf(b + r, " lba=0x%x\n",
+ r += sprintf(b + r, " lba=%#x\n",
((sense_buffer[1] & 0x1f) << 16) +
(sense_buffer[2] << 8) + sense_buffer[3]);
n += snprintf(buff + n, buff_len - n, "%s\n", b);
@@ -941,7 +941,7 @@ sg_get_opcode_sa_name(unsigned char cmd_byte0, int service_action,
if (vnp)
strncpy(buff, vnp->name, buff_len);
else
- snprintf(buff, buff_len, "Variable length service action=0x%x",
+ snprintf(buff, buff_len, "Variable length service action=%#x",
service_action);
break;
case SG_MAINTENANCE_IN:
@@ -949,7 +949,7 @@ sg_get_opcode_sa_name(unsigned char cmd_byte0, int service_action,
if (vnp)
strncpy(buff, vnp->name, buff_len);
else
- snprintf(buff, buff_len, "Maintenance in service action=0x%x",
+ snprintf(buff, buff_len, "Maintenance in service action=%#x",
service_action);
break;
case SG_MAINTENANCE_OUT:
@@ -957,7 +957,7 @@ sg_get_opcode_sa_name(unsigned char cmd_byte0, int service_action,
if (vnp)
strncpy(buff, vnp->name, buff_len);
else
- snprintf(buff, buff_len, "Maintenance out service action=0x%x",
+ snprintf(buff, buff_len, "Maintenance out service action=%#x",
service_action);
break;
case SG_SERVICE_ACTION_IN_12:
@@ -965,7 +965,7 @@ sg_get_opcode_sa_name(unsigned char cmd_byte0, int service_action,
if (vnp)
strncpy(buff, vnp->name, buff_len);
else
- snprintf(buff, buff_len, "Service action in(12)=0x%x",
+ snprintf(buff, buff_len, "Service action in(12)=%#x",
service_action);
break;
case SG_SERVICE_ACTION_OUT_12:
@@ -973,7 +973,7 @@ sg_get_opcode_sa_name(unsigned char cmd_byte0, int service_action,
if (vnp)
strncpy(buff, vnp->name, buff_len);
else
- snprintf(buff, buff_len, "Service action out(12)=0x%x",
+ snprintf(buff, buff_len, "Service action out(12)=%#x",
service_action);
break;
case SG_SERVICE_ACTION_IN_16:
@@ -981,7 +981,7 @@ sg_get_opcode_sa_name(unsigned char cmd_byte0, int service_action,
if (vnp)
strncpy(buff, vnp->name, buff_len);
else
- snprintf(buff, buff_len, "Service action in(16)=0x%x",
+ snprintf(buff, buff_len, "Service action in(16)=%#x",
service_action);
break;
case SG_SERVICE_ACTION_OUT_16:
@@ -989,7 +989,7 @@ sg_get_opcode_sa_name(unsigned char cmd_byte0, int service_action,
if (vnp)
strncpy(buff, vnp->name, buff_len);
else
- snprintf(buff, buff_len, "Service action out(16)=0x%x",
+ snprintf(buff, buff_len, "Service action out(16)=%#x",
service_action);
break;
case SG_PERSISTENT_RESERVE_IN:
@@ -998,7 +998,7 @@ sg_get_opcode_sa_name(unsigned char cmd_byte0, int service_action,
strncpy(buff, vnp->name, buff_len);
else
snprintf(buff, buff_len, "Persistent reserve in, service "
- "action=0x%x", service_action);
+ "action=%#x", service_action);
break;
case SG_PERSISTENT_RESERVE_OUT:
vnp = get_value_name(sg_lib_pr_out_arr, service_action, peri_type);
@@ -1006,7 +1006,7 @@ sg_get_opcode_sa_name(unsigned char cmd_byte0, int service_action,
strncpy(buff, vnp->name, buff_len);
else
snprintf(buff, buff_len, "Persistent reserve out, service "
- "action=0x%x", service_action);
+ "action=%#x", service_action);
break;
default:
sg_get_opcode_name(cmd_byte0, peri_type, buff_len, buff);
@@ -1038,17 +1038,17 @@ sg_get_opcode_name(unsigned char cmd_byte0, int peri_type, int buff_len,
if (vnp)
strncpy(buff, vnp->name, buff_len);
else
- snprintf(buff, buff_len, "Opcode=0x%x", (int)cmd_byte0);
+ snprintf(buff, buff_len, "Opcode=%#x", (int)cmd_byte0);
break;
case 3:
- snprintf(buff, buff_len, "Reserved [0x%x]", (int)cmd_byte0);
+ snprintf(buff, buff_len, "Reserved [%#x]", (int)cmd_byte0);
break;
case 6:
case 7:
- snprintf(buff, buff_len, "Vendor specific [0x%x]", (int)cmd_byte0);
+ snprintf(buff, buff_len, "Vendor specific [%#x]", (int)cmd_byte0);
break;
default:
- snprintf(buff, buff_len, "Opcode=0x%x", (int)cmd_byte0);
+ snprintf(buff, buff_len, "Opcode=%#x", (int)cmd_byte0);
break;
}
}
diff --git a/lib/sg_lib_data.c b/lib/sg_lib_data.c
index 2453275a..bff0c647 100644
--- a/lib/sg_lib_data.c
+++ b/lib/sg_lib_data.c
@@ -37,7 +37,7 @@
#endif
-const char * sg_lib_version_str = "1.51 20090607"; /* spc-4 rev 20 */
+const char * sg_lib_version_str = "1.51 20090716"; /* spc-4 rev 20 */
struct sg_lib_value_name_t sg_lib_normal_opcodes[] = {
{0, 0, "Test Unit Ready"},
diff --git a/lib/sg_pt_linux.c b/lib/sg_pt_linux.c
index 02365feb..bd915446 100644
--- a/lib/sg_pt_linux.c
+++ b/lib/sg_pt_linux.c
@@ -27,7 +27,7 @@
*
*/
-/* sg_pt_linux version 1.12 20090507 */
+/* sg_pt_linux version 1.12 20090716 */
#include <stdio.h>
#include <stdlib.h>
@@ -141,7 +141,7 @@ scsi_pt_open_flags(const char * device_name, int flags, int verbose)
if (verbose > 1) {
if (NULL == sg_warnings_strm)
sg_warnings_strm = stderr;
- fprintf(sg_warnings_strm, "open %s with flags=0x%x\n", device_name,
+ fprintf(sg_warnings_strm, "open %s with flags=%#x\n", device_name,
flags);
}
fd = open(device_name, flags);
@@ -417,9 +417,9 @@ get_scsi_pt_transport_err_str(const struct sg_pt_base * vp, int max_b_len,
n = 0;
if (hs) {
if ((hs < 0) || (hs >= LINUX_HOST_BYTES_SZ))
- n = snprintf(cp, m, "Host_status=0x%02x is invalid\n", hs);
+ n = snprintf(cp, m, "Host_status=%#02x is invalid\n", hs);
else
- n = snprintf(cp, m, "Host_status=0x%02x [%s]\n", hs,
+ n = snprintf(cp, m, "Host_status=%#02x [%s]\n", hs,
linux_host_bytes[hs]);
}
m -= n;
@@ -434,7 +434,7 @@ get_scsi_pt_transport_err_str(const struct sg_pt_base * vp, int max_b_len,
sugg = (ds & SG_LIB_SUGGEST_MASK) >> 4;
if (sugg < LINUX_DRIVER_SUGGESTS_SZ)
sugg_cp = linux_driver_suggests[sugg];
- n = snprintf(cp, m, "Driver_status=0x%02x [%s, %s]\n", ds, driv_cp,
+ n = snprintf(cp, m, "Driver_status=%#02x [%s, %s]\n", ds, driv_cp,
sugg_cp);
m -= n;
if (m < 1)
@@ -567,7 +567,7 @@ scsi_pt_open_flags(const char * device_name, int flags, int verbose)
if (verbose > 1) {
if (NULL == sg_warnings_strm)
sg_warnings_strm = stderr;
- fprintf(sg_warnings_strm, "open %s with flags=0x%x\n", device_name,
+ fprintf(sg_warnings_strm, "open %s with flags=%#x\n", device_name,
flags);
}
fd = open(device_name, flags);
@@ -773,9 +773,9 @@ get_scsi_pt_transport_err_str(const struct sg_pt_base * vp, int max_b_len,
n = 0;
if (hs) {
if ((hs < 0) || (hs >= LINUX_HOST_BYTES_SZ))
- n = snprintf(cp, m, "Host_status=0x%02x is invalid\n", hs);
+ n = snprintf(cp, m, "Host_status=%#02x is invalid\n", hs);
else
- n = snprintf(cp, m, "Host_status=0x%02x [%s]\n", hs,
+ n = snprintf(cp, m, "Host_status=%#02x [%s]\n", hs,
linux_host_bytes[hs]);
}
m -= n;
@@ -790,7 +790,7 @@ get_scsi_pt_transport_err_str(const struct sg_pt_base * vp, int max_b_len,
sugg = (ds & SG_LIB_SUGGEST_MASK) >> 4;
if (sugg < LINUX_DRIVER_SUGGESTS_SZ)
sugg_cp = linux_driver_suggests[sugg];
- n = snprintf(cp, m, "Driver_status=0x%02x [%s, %s]\n", ds, driv_cp,
+ n = snprintf(cp, m, "Driver_status=%#02x [%s, %s]\n", ds, driv_cp,
sugg_cp);
m -= n;
if (m < 1)
diff --git a/lib/sg_pt_solaris.c b/lib/sg_pt_solaris.c
index 7c682f35..37c44996 100644
--- a/lib/sg_pt_solaris.c
+++ b/lib/sg_pt_solaris.c
@@ -27,7 +27,7 @@
*
*/
-/* sg_pt_solaris version 1.02 20090204 */
+/* sg_pt_solaris version 1.02 20090716 */
#include <stdio.h>
#include <stdlib.h>
@@ -87,7 +87,7 @@ scsi_pt_open_flags(const char * device_name, int flags_arg, int verbose)
flags_arg = flags_arg; /* ignore flags argument, suppress warning */
if (verbose > 1) {
- fprintf(stderr, "open %s with flags=0x%x\n", device_name, oflags);
+ fprintf(stderr, "open %s with flags=%#x\n", device_name, oflags);
}
fd = open(device_name, oflags);
if (fd < 0)
diff --git a/sg3_utils.spec b/sg3_utils.spec
index c5215fe5..0d73cb2e 100644
--- a/sg3_utils.spec
+++ b/sg3_utils.spec
@@ -79,7 +79,7 @@ fi
%{_libdir}/*.la
%changelog
-* Mon Jun 22 2009 - dgilbert at interlog dot com
+* Wed Jul 22 2009 - dgilbert at interlog dot com
- add sg_unmap, sg_read_block_limits; sg_logs: cache memory stats lpage
* sg3_utils-1.28
diff --git a/utils/sg_chk_asc.c b/utils/sg_chk_asc.c
index 14d2c090..e27e5eb0 100644
--- a/utils/sg_chk_asc.c
+++ b/utils/sg_chk_asc.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006-2008 Douglas Gilbert.
+ * Copyright (c) 2006-2009 Douglas Gilbert.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -47,7 +47,7 @@
* http://www.t10.org/lists/asc-num.txt
*/
-static char * version_str = "1.03 20080623";
+static char * version_str = "1.03 20080716";
#define ME "sg_chk_asc: "
@@ -109,7 +109,7 @@ int main(int argc, char * argv[])
fprintf(stderr, ME "version: %s\n", version_str);
return 0;
default:
- fprintf(stderr, "unrecognised switch code 0x%x ??\n", c);
+ fprintf(stderr, "unrecognised switch code %#x ??\n", c);
usage();
return 1;
}