diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2013-08-19 01:44:18 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2013-08-19 01:44:18 +0000 |
commit | 11478117546b77c5c5693ea5d7b6aae02f9eb0f7 (patch) | |
tree | e52e1f83ea35d00d4e05b50ee8b6bfed3cb11271 | |
parent | 06df6b477dd157e72a130704d8b11ca97e335012 (diff) | |
download | sg3_utils-11478117546b77c5c5693ea5d7b6aae02f9eb0f7.tar.gz |
sg_xcopy: fix for sg and bsg nodes
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@508 6180dd3e-e324-4e3e-922d-17de1ae2f315
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | debian/changelog | 2 | ||||
-rw-r--r-- | sg3_utils.spec | 2 | ||||
-rw-r--r-- | src/sg_xcopy.c | 27 |
5 files changed, 30 insertions, 5 deletions
@@ -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 [20130817] [svn: r507] +Changelog for sg3_utils-1.37 [20130818] [svn: r508] - sg_compare_and_write: fix wrprotect setting - sg_inq: fix referrals VPD page - dev_id VPD: T10 vendor id designator clean up @@ -391,4 +391,4 @@ See http://sg.danny.cz/sg/tools.html Douglas Gilbert -17th August 2013 +18th August 2013 diff --git a/debian/changelog b/debian/changelog index 8e9f019d..e9ea2199 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, 17 Aug 2013 13:00:00 -0400 + -- Douglas Gilbert <dgilbert@interlog.com> Sun, 18 Aug 2013 21:00:00 -0400 sg3-utils (1.36-0.1) unstable; urgency=low diff --git a/sg3_utils.spec b/sg3_utils.spec index e8adb667..8d3379aa 100644 --- a/sg3_utils.spec +++ b/sg3_utils.spec @@ -79,7 +79,7 @@ fi %{_libdir}/*.la %changelog -* Sat Aug 17 2013 - dgilbert at interlog dot com +* Sun Aug 17 2013 - dgilbert at interlog dot com - track t10 changes * sg3_utils-1.37 diff --git a/src/sg_xcopy.c b/src/sg_xcopy.c index 1a578424..f62b26e5 100644 --- a/src/sg_xcopy.c +++ b/src/sg_xcopy.c @@ -411,6 +411,30 @@ dd_filetype_str(int ft, char * buff) } static int +simplified_ft(const struct xcopy_fp_t * xfp) +{ + int ftype = xfp->sg_type; + + switch (ftype) { + case FT_BLOCK: + case FT_ST: + case FT_OTHER: /* typically regular file */ + case FT_DEV_NULL: + case FT_FIFO: + case FT_ERROR: + return ftype; + default: + if (FT_SG & ftype) { + if ((0 == xfp->pdt) || (0xe == xfp->pdt)) /* D-A or RBC */ + return FT_BLOCK; + else if (0x1 == xfp->pdt) + return FT_ST; + } + return FT_OTHER; + } +} + +static int seg_desc_from_dd_type(int in_ft, int in_off, int out_ft, int out_off) { int desc_type = -1; @@ -1850,7 +1874,8 @@ main(int argc, char * argv[]) bpt = (r > MAX_BLOCKS_PER_TRANSFER) ? MAX_BLOCKS_PER_TRANSFER : r; } - seg_desc_type = seg_desc_from_dd_type(ixcf.sg_type, 0, oxcf.sg_type, 0); + seg_desc_type = seg_desc_from_dd_type(simplified_ft(&ixcf), 0, + simplified_ft(&oxcf), 0); if (do_time) { start_tm.tv_sec = 0; |