aboutsummaryrefslogtreecommitdiff
path: root/src/sg_sanitize.c
diff options
context:
space:
mode:
authorDouglas Gilbert <dgilbert@interlog.com>2018-01-19 13:08:58 +0000
committerDouglas Gilbert <dgilbert@interlog.com>2018-01-19 13:08:58 +0000
commit400444efd4e3c2cd758aee250556c84e052634dc (patch)
tree4db54605f35f18dc4d997263e0218974ecfba463 /src/sg_sanitize.c
parent239d147229acac3d3504360a38cd5ec8505d0d5e (diff)
downloadsg3_utils-400444efd4e3c2cd758aee250556c84e052634dc.tar.gz
add hex2stdout(), hex2stderr() and hex2str(); add testing/sg_tst_nvme; clean Makefile.freebsd in examples/ and testing/; NVMe error processing
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@745 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src/sg_sanitize.c')
-rw-r--r--src/sg_sanitize.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/sg_sanitize.c b/src/sg_sanitize.c
index 8e6ac6f3..a346887d 100644
--- a/src/sg_sanitize.c
+++ b/src/sg_sanitize.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011-2017 Douglas Gilbert.
+ * Copyright (c) 2011-2018 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.
@@ -30,7 +30,7 @@
#include "sg_unaligned.h"
#include "sg_pr2serr.h"
-static const char * version_str = "1.04 20171008";
+static const char * version_str = "1.05 20180118";
/* Not all environments support the Unix sleep() */
#if defined(MSC_VER) || defined(__MINGW32__)
@@ -212,7 +212,7 @@ do_sanitize(int sg_fd, const struct opts_t * op, const void * param_lstp,
if (op->verbose > 2) {
if (param_lst_len > 0) {
pr2serr(" Parameter list contents:\n");
- dStrHexErr((const char *)param_lstp, param_lst_len, 1);
+ hex2stderr(param_lstp, param_lst_len, 1);
}
pr2serr(" Sanitize command timeout: %d seconds\n", timeout);
}
@@ -690,7 +690,7 @@ main(int argc, char * argv[])
}
if ((0 == ret) && (! op->early) && (! op->wait)) {
- for (k = 0 ;; ++k) {
+ for (k = 0; ;++k) { /* unbounded, exits via break */
sleep_for(POLL_DURATION_SECS);
memset(rsBuff, 0x0, sizeof(rsBuff));
res = sg_ll_request_sense(sg_fd, op->desc, rsBuff, sizeof(rsBuff),
@@ -720,7 +720,7 @@ main(int argc, char * argv[])
resp_len = rsBuff[7] + 8;
if (vb > 2) {
pr2serr("Parameter data in hex\n");
- dStrHexErr((const char *)rsBuff, resp_len, 1);
+ hex2stderr(rsBuff, resp_len, 1);
}
progress = -1;
sg_get_sense_progress_fld(rsBuff, resp_len, &progress);