aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--README2
-rw-r--r--debian/changelog2
-rw-r--r--sg3_utils.spec2
-rw-r--r--src/sg_inq.c24
-rw-r--r--src/sg_inq_data.c14
-rw-r--r--src/sg_logs.c4
-rw-r--r--src/sg_readcap.c6
-rw-r--r--src/sg_requests.c10
-rw-r--r--src/sg_senddiag.c4
-rw-r--r--src/sg_ses.c10
-rw-r--r--src/sg_turs.c12
-rw-r--r--src/sg_vpd_vendor.c8
13 files changed, 44 insertions, 58 deletions
diff --git a/ChangeLog b/ChangeLog
index 1b5e35d8..967a6499 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,8 +2,8 @@ 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 [20090422] [svn: r257]
- - sg_libs: sg_set_binary_mode() inactive because config.h not
+Changelog for sg3_utils-1.28 [20090422] [svn: r259]
+ - sg_lib: sg_set_binary_mode() inactive because config.h not
included
- change SG3_UTILS_* constants to SG_LIB_*
- utils/hxascdmp: in Windows set binary mode on read files
diff --git a/README b/README
index 57e87476..ff880b9e 100644
--- a/README
+++ b/README
@@ -335,4 +335,4 @@ See http://sg.danny.cz/sg/tools.html
Doug Gilbert
-20th April 2009
+22nd April 2009
diff --git a/debian/changelog b/debian/changelog
index 35fd7ef5..4a4fcdc9 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -2,7 +2,7 @@ sg3-utils (1.28-0.1) unstable; urgency=low
* New upstream version
- -- Doug Gilbert <dgilbert@interlog.com> Mon, 20 Apr 2009 18:00:00 -0400
+ -- Doug Gilbert <dgilbert@interlog.com> Wed, 22 Apr 2009 15:30:00 -0400
sg3-utils (1.27-0.1) unstable; urgency=low
diff --git a/sg3_utils.spec b/sg3_utils.spec
index b82797d4..7a19a015 100644
--- a/sg3_utils.spec
+++ b/sg3_utils.spec
@@ -79,7 +79,7 @@ fi
%{_libdir}/*.la
%changelog
-* Mon Apr 20 2009 - dgilbert at interlog dot com
+* Wed Apr 22 2009 - dgilbert at interlog dot com
- xxxxxxxxxxxxxxx
* sg3_utils-1.28
diff --git a/src/sg_inq.c b/src/sg_inq.c
index 812d9077..ba9915a9 100644
--- a/src/sg_inq.c
+++ b/src/sg_inq.c
@@ -11,7 +11,7 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#ifdef SG3_UTILS_LINUX
+#ifdef SG_LIB_LINUX
#include <errno.h>
#include <sys/ioctl.h>
#include <sys/types.h>
@@ -66,7 +66,7 @@
* information [MAINTENANCE IN, service action = 0xc]; see sg_opcodes.
*/
-static char * version_str = "0.81 20090329"; /* SPC-4 rev 18 */
+static char * version_str = "0.82 20090422"; /* SPC-4 rev 18 */
#define VPD_SUPPORTED_VPDS 0x0
@@ -109,7 +109,7 @@ static void decode_dev_ids(const char * leadin, unsigned char * buff,
static void decode_transport_id(const char * leadin, unsigned char * ucp,
int len);
-#ifdef SG3_UTILS_LINUX
+#ifdef SG_LIB_LINUX
static int try_ata_identify(int ata_fd, int do_hex, int do_raw,
int do_verbose);
#endif
@@ -160,7 +160,7 @@ static struct svpd_values_name_t vpd_pg[] = {
};
static struct option long_options[] = {
-#ifdef SG3_UTILS_LINUX
+#ifdef SG_LIB_LINUX
{"ata", 0, 0, 'a'},
#endif
{"cmddt", 0, 0, 'c'},
@@ -205,7 +205,7 @@ struct opts_t {
static void
usage()
{
-#ifdef SG3_UTILS_LINUX
+#ifdef SG_LIB_LINUX
fprintf(stderr,
"Usage: sg_inq [--ata] [--cmddt] [--descriptors] [--extended] "
"[--help] [--hex]\n"
@@ -257,7 +257,7 @@ usage()
static void
usage_old()
{
-#ifdef SG3_UTILS_LINUX
+#ifdef SG_LIB_LINUX
fprintf(stderr,
"Usage: sg_inq [-a] [-A] [-b] [-c] [-cl] [-d] [-e] [-h] [-H] "
"[-i]\n"
@@ -326,7 +326,7 @@ process_cl_new(struct opts_t * optsp, int argc, char * argv[])
while (1) {
int option_index = 0;
-#ifdef SG3_UTILS_LINUX
+#ifdef SG_LIB_LINUX
c = getopt_long(argc, argv, "acdeEhHil:m:NOp:rvVx", long_options,
&option_index);
#else
@@ -337,7 +337,7 @@ process_cl_new(struct opts_t * optsp, int argc, char * argv[])
break;
switch (c) {
-#ifdef SG3_UTILS_LINUX
+#ifdef SG_LIB_LINUX
case 'a':
++optsp->do_ata;
break;
@@ -450,7 +450,7 @@ process_cl_old(struct opts_t * optsp, int argc, char * argv[])
++optsp->do_vpd;
++optsp->num_pages;
break;
-#ifdef SG3_UTILS_LINUX
+#ifdef SG_LIB_LINUX
case 'A':
++optsp->do_ata;
break;
@@ -1877,7 +1877,7 @@ process_std_inq(int sg_fd, const struct opts_t * optsp)
}
}
} else if (res < 0) { /* could be an ATA device */
-#ifdef SG3_UTILS_LINUX
+#ifdef SG_LIB_LINUX
/* Try an ATA Identify Device command */
res = try_ata_identify(sg_fd, optsp->do_hex, optsp->do_raw,
optsp->do_verbose);
@@ -2676,7 +2676,7 @@ main(int argc, char * argv[])
}
memset(rsp_buff, 0, sizeof(rsp_buff));
-#ifdef SG3_UTILS_LINUX
+#ifdef SG_LIB_LINUX
if (opts.do_ata) {
res = try_ata_identify(sg_fd, opts.do_hex, opts.do_raw,
opts.do_verbose);
@@ -2724,7 +2724,7 @@ err_out:
}
-#ifdef SG3_UTILS_LINUX
+#ifdef SG_LIB_LINUX
/* Following code permits ATA IDENTIFY commands to be performed on
ATA non "Packet Interface" devices (e.g. ATA disks).
GPL-ed code borrowed from smartmontools (smartmontools.sf.net).
diff --git a/src/sg_inq_data.c b/src/sg_inq_data.c
index 9605c6d9..b1175271 100644
--- a/src/sg_inq_data.c
+++ b/src/sg_inq_data.c
@@ -2,25 +2,11 @@
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <getopt.h>
-#define __STDC_FORMAT_MACROS 1
-#include <inttypes.h>
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#ifdef SG3_UTILS_LINUX
-#include <errno.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <linux/hdreg.h>
-#endif
-#include "sg_lib.h"
-#include "sg_cmds_basic.h"
/* A utility program originally written for the Linux OS SCSI subsystem.
* Copyright (C) 2000-2009 D. Gilbert
diff --git a/src/sg_logs.c b/src/sg_logs.c
index 2feee6cf..5023ac2d 100644
--- a/src/sg_logs.c
+++ b/src/sg_logs.c
@@ -25,7 +25,7 @@
*/
-static char * version_str = "0.84 20090327"; /* SPC-4 revision 18 */
+static char * version_str = "0.84 20090422"; /* SPC-4 revision 18 */
#define MX_ALLOC_LEN (0xfffc)
#define SHORT_RESP_LEN 128
@@ -2259,7 +2259,7 @@ show_background_scan_results_page(unsigned char * resp, int len, int show_pcb,
j = (ucp[10] << 8) + ucp[11];
printf(" Number of background scans performed: %d\n", j);
j = (ucp[12] << 8) + ucp[13];
-#ifdef SG3_UTILS_MINGW
+#ifdef SG_LIB_MINGW
printf(" Background medium scan progress: %g%%\n",
(double)(j * 100.0 / 65536.0));
#else
diff --git a/src/sg_readcap.c b/src/sg_readcap.c
index d19ded20..f0433ede 100644
--- a/src/sg_readcap.c
+++ b/src/sg_readcap.c
@@ -28,7 +28,7 @@
*/
-static char * version_str = "3.84 20090410";
+static char * version_str = "3.84 20090422";
#define ME "sg_readcap: "
@@ -426,7 +426,7 @@ int main(int argc, char * argv[])
sz_gb = ((double)(last_blk_addr + 1) * block_size) /
(double)(1000000000L);
printf("Hence:\n");
-#ifdef SG3_UTILS_MINGW
+#ifdef SG_LIB_MINGW
printf(" Device size: %" PRIu64 " bytes, %g MiB, %g "
"GB\n", total_sz, sz_mb, sz_gb);
#else
@@ -514,7 +514,7 @@ int main(int argc, char * argv[])
sz_gb = ((double)(llast_blk_addr + 1) * block_size) /
(double)(1000000000L);
printf("Hence:\n");
-#ifdef SG3_UTILS_MINGW
+#ifdef SG_LIB_MINGW
printf(" Device size: %" PRIu64 " bytes, %g MiB, %g GB\n",
total_sz, sz_mb, sz_gb);
#else
diff --git a/src/sg_requests.c b/src/sg_requests.c
index 44e2f1bf..f879f8f6 100644
--- a/src/sg_requests.c
+++ b/src/sg_requests.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2004-2008 Douglas Gilbert.
+ * Copyright (c) 2004-2009 Douglas Gilbert.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -47,7 +47,7 @@
* This program issues the SCSI command REQUEST SENSE to the given SCSI device.
*/
-static char * version_str = "1.21 20080510";
+static char * version_str = "1.21 20090422";
#define MAX_REQS_RESP_LEN 255
#define DEF_REQS_RESP_LEN 252
@@ -140,7 +140,7 @@ main(int argc, char * argv[])
int verbose = 0;
const char * device_name = NULL;
int ret = 0;
-#ifndef SG3_UTILS_MINGW
+#ifndef SG_LIB_MINGW
struct timeval start_tm, end_tm;
#endif
@@ -293,7 +293,7 @@ main(int argc, char * argv[])
goto finish;
}
-#ifndef SG3_UTILS_MINGW
+#ifndef SG_LIB_MINGW
if (do_time) {
start_tm.tv_sec = 0;
start_tm.tv_usec = 0;
@@ -349,7 +349,7 @@ main(int argc, char * argv[])
}
}
}
-#ifndef SG3_UTILS_MINGW
+#ifndef SG_LIB_MINGW
if ((do_time) && (start_tm.tv_sec || start_tm.tv_usec)) {
struct timeval res_tm;
double a, b;
diff --git a/src/sg_senddiag.c b/src/sg_senddiag.c
index 63313ace..ae2bce0a 100644
--- a/src/sg_senddiag.c
+++ b/src/sg_senddiag.c
@@ -24,7 +24,7 @@
the SCSI RECEIVE DIAGNOSTIC command to list supported diagnostic pages.
*/
-static char * version_str = "0.35 20090401";
+static char * version_str = "0.35 20090422";
#define ME "sg_senddiag: "
@@ -683,7 +683,7 @@ int main(int argc, char * argv[])
int secs;
secs = (rsp_buff[18] << 8) + rsp_buff[19];
-#ifdef SG3_UTILS_MINGW
+#ifdef SG_LIB_MINGW
printf("Expected extended self-test duration=%d seconds "
"(%g minutes)\n", secs, secs / 60.0);
#else
diff --git a/src/sg_ses.c b/src/sg_ses.c
index bba29e6e..b86bd9dd 100644
--- a/src/sg_ses.c
+++ b/src/sg_ses.c
@@ -46,7 +46,7 @@
* commands tailored for SES (enclosure) devices.
*/
-static char * version_str = "1.44 20090401"; /* ses2r19b */
+static char * version_str = "1.44 20090422"; /* ses2r19b */
#define MX_ALLOC_LEN 4096
#define MX_ELEM_HDR 1024
@@ -782,7 +782,7 @@ print_element_status(const char * pad, const unsigned char * statp, int etype,
!!(statp[1] & 0x4), !!(statp[1] & 0x2));
printf("Crit Under=%d\n", !!(statp[1] & 0x1));
}
-#ifdef SG3_UTILS_MINGW
+#ifdef SG_LIB_MINGW
printf("%sVoltage: %g volts\n", pad,
((int)(short)((statp[2] << 8) + statp[3]) / 100.0));
#else
@@ -795,7 +795,7 @@ print_element_status(const char * pad, const unsigned char * statp, int etype,
printf("%sIdent=%d, Fail=%d, Warn Over=%d, Crit Over=%d\n",
pad, !!(statp[1] & 0x80), !!(statp[1] & 0x40),
!!(statp[1] & 0x8), !!(statp[1] & 0x2));
-#ifdef SG3_UTILS_MINGW
+#ifdef SG_LIB_MINGW
printf("%sCurrent: %g amps\n", pad,
((int)(short)((statp[2] << 8) + statp[3]) / 100.0));
#else
@@ -988,7 +988,7 @@ ses_threshold_helper(const char * pad, const unsigned char *tp, int etype,
printf("low critical=%s (in minutes)\n", b);
break;
case 0x12: /* voltage */
-#ifdef SG3_UTILS_MINGW
+#ifdef SG_LIB_MINGW
printf("%s%s: high critical=%g %%, high warning=%g %%\n", pad,
buff, 0.5 * tp[0], 0.5 * tp[1]);
printf("%s low warning=%g %%, low critical=%g %% (from nominal "
@@ -1001,7 +1001,7 @@ ses_threshold_helper(const char * pad, const unsigned char *tp, int etype,
#endif
break;
case 0x13: /* current */
-#ifdef SG3_UTILS_MINGW
+#ifdef SG_LIB_MINGW
printf("%s%s: high critical=%g %%, high warning=%g %%\n", pad,
buff, 0.5 * tp[0], 0.5 * tp[1]);
#else
diff --git a/src/sg_turs.c b/src/sg_turs.c
index ee65dc25..933fb66f 100644
--- a/src/sg_turs.c
+++ b/src/sg_turs.c
@@ -9,7 +9,7 @@
#include "config.h"
#endif
-#ifndef SG3_UTILS_MINGW
+#ifndef SG_LIB_MINGW
#include <sys/time.h>
#endif
@@ -21,7 +21,7 @@
data transfer (and no REQUEST SENSE command iff the unit is ready)
then this can be used for timing per SCSI command overheads.
- * Copyright (C) 2000-2007 D. Gilbert
+ * Copyright (C) 2000-2009 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)
@@ -29,7 +29,7 @@
*/
-static char * version_str = "3.26 20070714";
+static char * version_str = "3.27 20090422";
#if defined(MSC_VER) || defined(__MINGW32__)
#define HAVE_MS_SLEEP
@@ -269,7 +269,7 @@ int main(int argc, char * argv[])
int num_errs = 0;
int reported = 0;
int ret = 0;
-#ifndef SG3_UTILS_MINGW
+#ifndef SG_LIB_MINGW
struct timeval start_tm, end_tm;
#endif
struct opts_t opts;
@@ -318,7 +318,7 @@ int main(int argc, char * argv[])
printf("Completed %d Test Unit Ready commands\n",
((k < opts.do_number) ? k + 1 : k));
} else {
-#ifndef SG3_UTILS_MINGW
+#ifndef SG_LIB_MINGW
if (opts.do_time) {
start_tm.tv_sec = 0;
start_tm.tv_usec = 0;
@@ -337,7 +337,7 @@ int main(int argc, char * argv[])
}
}
}
-#ifndef SG3_UTILS_MINGW
+#ifndef SG_LIB_MINGW
if ((opts.do_time) && (start_tm.tv_sec || start_tm.tv_usec)) {
struct timeval res_tm;
double a, b;
diff --git a/src/sg_vpd_vendor.c b/src/sg_vpd_vendor.c
index 77f8c9e2..7b58cf90 100644
--- a/src/sg_vpd_vendor.c
+++ b/src/sg_vpd_vendor.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
@@ -33,7 +33,7 @@
#include <stdlib.h>
#include <string.h>
-#ifndef SG3_UTILS_MINGW
+#ifndef SG_LIB_MINGW
#include <time.h>
#endif
@@ -447,7 +447,7 @@ static void
decode_rdac_vpd_c8(unsigned char * buff, int len)
{
int i;
-#ifndef SG3_UTILS_MINGW
+#ifndef SG_LIB_MINGW
time_t tstamp;
#endif
char *c;
@@ -475,7 +475,7 @@ decode_rdac_vpd_c8(unsigned char * buff, int len)
}
printf(" Volume Unique Identifier: %s\n", uuid);
-#ifndef SG3_UTILS_MINGW
+#ifndef SG_LIB_MINGW
tstamp = (buff[24] << 24) + (buff[25] << 16) + (buff[26] << 8) + buff[27];
printf(" Creation Number: %d, Timestamp: %s",
(buff[22] << 8) + buff[23], ctime(&tstamp));