From 01b921a673f96854eadf95a84f34e837eb8237ea Mon Sep 17 00:00:00 2001
From: ballen4705 <ballen4705@4ea69e1a-61f1-4043-bf83-b5c94c648137>
Date: Tue, 14 Jan 2003 20:04:07 +0000
Subject: [PATCH] If Attribute 9 stored in minutes, print as Xh+Ym not X h + Y
 m.  This keeps the number of fields fixed.

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@447 4ea69e1a-61f1-4043-bf83-b5c94c648137
---
 sm5/CHANGELOG    |  5 ++++-
 sm5/ataprint.c   |  4 ++--
 sm5/ataprint.cpp |  4 ++--
 sm5/smartctl.8   | 12 +++++++-----
 4 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/sm5/CHANGELOG b/sm5/CHANGELOG
index cb84798c5..fa9d22b7d 100644
--- a/sm5/CHANGELOG
+++ b/sm5/CHANGELOG
@@ -1,6 +1,6 @@
 CHANGELOG for smartmontools
 
-$Id: CHANGELOG,v 1.85 2003/01/13 12:49:06 ballen4705 Exp $
+$Id: CHANGELOG,v 1.86 2003/01/14 20:04:03 ballen4705 Exp $
 
 Copyright (C) 2002 Bruce Allen <smartmontools-support@lists.sourceforge.net>
 
@@ -33,6 +33,9 @@ NOTES FOR FUTURE RELEASES: see TODO file.
 
 CURRENT RELEASE (see VERSION file in this directory):
 
+  [BA] Modified printing format for 9,minutes to read
+       Xh+Ym not X h + Y m, so that fields are fixed width.
+
   [BA] Added Attribute 240 "head flying hours"
 
 smartmontools-5.1.1
diff --git a/sm5/ataprint.c b/sm5/ataprint.c
index 83748ac9e..ee82f5525 100644
--- a/sm5/ataprint.c
+++ b/sm5/ataprint.c
@@ -31,7 +31,7 @@
 #include "smartctl.h"
 #include "extern.h"
 
-const char *CVSid2="$Id: ataprint.c,v 1.53 2003/01/12 10:30:53 ballen4705 Exp $"
+const char *CVSid2="$Id: ataprint.c,v 1.54 2003/01/14 20:04:07 ballen4705 Exp $"
 CVSID1 CVSID2 CVSID3 CVSID6;
 
 // for passing global control variables
@@ -442,7 +442,7 @@ void PrintSmartAttribWithThres (struct ata_smart_values *data,
 	  // minutes
 	  long long tmp1=rawvalue/60;
 	  long long tmp2=rawvalue%60;
-	  pout("%llu h + %2llu m\n", tmp1, tmp2);
+	  pout("%lluh+%02llum\n", tmp1, tmp2);
 	}
 	else
 	  // hours
diff --git a/sm5/ataprint.cpp b/sm5/ataprint.cpp
index f152a7195..2f86df996 100644
--- a/sm5/ataprint.cpp
+++ b/sm5/ataprint.cpp
@@ -31,7 +31,7 @@
 #include "smartctl.h"
 #include "extern.h"
 
-const char *CVSid2="$Id: ataprint.cpp,v 1.53 2003/01/12 10:30:53 ballen4705 Exp $"
+const char *CVSid2="$Id: ataprint.cpp,v 1.54 2003/01/14 20:04:07 ballen4705 Exp $"
 CVSID1 CVSID2 CVSID3 CVSID6;
 
 // for passing global control variables
@@ -442,7 +442,7 @@ void PrintSmartAttribWithThres (struct ata_smart_values *data,
 	  // minutes
 	  long long tmp1=rawvalue/60;
 	  long long tmp2=rawvalue%60;
-	  pout("%llu h + %2llu m\n", tmp1, tmp2);
+	  pout("%lluh+%02llum\n", tmp1, tmp2);
 	}
 	else
 	  // hours
diff --git a/sm5/smartctl.8 b/sm5/smartctl.8
index cf4840ae5..5c573969c 100644
--- a/sm5/smartctl.8
+++ b/sm5/smartctl.8
@@ -1,6 +1,6 @@
 \# Copyright (C) 2002 Bruce Allen <smartmontools-support@lists.sourceforge.net>
 \#
-\# $Id: smartctl.8,v 1.43 2003/01/06 00:54:16 ballen4705 Exp $
+\# $Id: smartctl.8,v 1.44 2003/01/14 20:04:05 ballen4705 Exp $
 \# 
 \# 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
@@ -16,7 +16,7 @@
 \# Research Center), Jack Baskin School of Engineering, University of
 \# California, Santa Cruz. http://ssrc.soe.ucsc.edu/
 \#
-.TH SMARTCTL 8  "$Date: 2003/01/06 00:54:16 $" "smartmontools-5.1"
+.TH SMARTCTL 8  "$Date: 2003/01/14 20:04:05 $" "smartmontools-5.1"
 .SH NAME
 smartctl \- S.M.A.R.T. control and monitor utility 
 .SH SYNOPSIS
@@ -419,8 +419,10 @@ arguments to this option are:
 then exits.
 
 .I 9,minutes
-\- Raw Attribute number 9 is power-on time in minutes.  It will be
-displayed in the form 'X h + Y m', where X is hours and Y is minutes.
+\- Raw Attribute number 9 is power-on time in minutes.  Its raw value
+will be displayed in the form 'Xh+Ym'.  Here X is hours, and Y is
+minutes in the range 0-59 inclusive.  Y is always printed with two
+digits, for example \'06' or \'31' or '00'.
 
 .I 9,temp
 \- Raw Attribute number 9 is the disk temperature in Celsius.
@@ -676,4 +678,4 @@ Please let us know if there is an on\-line source for this document.
 
 .SH
 CVS ID OF THIS PAGE:
-$Id: smartctl.8,v 1.43 2003/01/06 00:54:16 ballen4705 Exp $
+$Id: smartctl.8,v 1.44 2003/01/14 20:04:05 ballen4705 Exp $
-- 
GitLab