lshw/SOURCES/0001-Do-not-show-modified-t...

43 lines
1.5 KiB
Diff

From 1553540346701a501f77e73ba45b24e586013584 Mon Sep 17 00:00:00 2001
From: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
Date: Thu, 13 Jul 2017 14:18:08 +0530
Subject: [PATCH] Do not show modified time with -notime option
Exclude volatile attributes (timestamps) from lshw -notime output.
Signed-off-by: Seeteena Thoufeek <s1seetee@linux.vnet.ibm.com>
[Updated description and fixed detect_hfsx() - Vasant]
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
---
src/core/volumes.cc | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/core/volumes.cc b/src/core/volumes.cc
index 07a253bddbf1..456809a37ae2 100644
--- a/src/core/volumes.cc
+++ b/src/core/volumes.cc
@@ -651,8 +651,10 @@ static bool detect_hfsx(hwNode & n, source & s)
wtime = (time_t)(be_long(&vol->modifyDate) - HFSTIMEOFFSET);
n.setConfig("created", datetime(mkfstime, false)); // creation time uses local time
if (enabled("output:time"))
+ {
n.setConfig("checked", datetime(fscktime));
- n.setConfig("modified", datetime(wtime));
+ n.setConfig("modified", datetime(wtime));
+ }
return true;
}
@@ -742,7 +744,7 @@ static bool detect_hfs(hwNode & n, source & s)
n.setConfig("created", datetime(mkfstime - HFSTIMEOFFSET, false)); // all dates use local time
if(dumptime)
n.setConfig("backup", datetime(dumptime - HFSTIMEOFFSET, false));
- if(wtime)
+ if(wtime && enabled("output:time"))
n.setConfig("modified", datetime(wtime - HFSTIMEOFFSET, false));
return true;
--
2.17.1