From 3fd8ed1d4fae0652e609467dd5993fdf3691a453 Mon Sep 17 00:00:00 2001
From: chrfranke <chrfranke@4ea69e1a-61f1-4043-bf83-b5c94c648137>
Date: Sat, 16 Jan 2010 14:18:42 +0000
Subject: [PATCH] smartctl: Don't print log directory if '-q errorsonly' is
 specified.

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@3033 4ea69e1a-61f1-4043-bf83-b5c94c648137
---
 smartmontools/CHANGELOG    |  2 ++
 smartmontools/ataprint.cpp | 10 ++--------
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/smartmontools/CHANGELOG b/smartmontools/CHANGELOG
index 35bdb9393..75597c3d5 100644
--- a/smartmontools/CHANGELOG
+++ b/smartmontools/CHANGELOG
@@ -43,6 +43,8 @@ NOTES FOR FUTURE RELEASES: see TODO file.
 
 <DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE>
 
+  [CF] smartctl: Don't print log directory if '-q errorsonly' is specified.
+
   [CF] smartctl: Fix option '-q, --quietmode' (ticket #11).
        Regression was introduced with r2807.
 
diff --git a/smartmontools/ataprint.cpp b/smartmontools/ataprint.cpp
index 51fef8ac8..524861258 100644
--- a/smartmontools/ataprint.cpp
+++ b/smartmontools/ataprint.cpp
@@ -3,8 +3,8 @@
  *
  * Home page of code is: http://smartmontools.sourceforge.net
  *
- * Copyright (C) 2002-9 Bruce Allen <smartmontools-support@lists.sourceforge.net>
- * Copyright (C) 2008-9 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2002-10 Bruce Allen <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2008-10 Christian Franke <smartmontools-support@lists.sourceforge.net>
  * Copyright (C) 1999-2000 Michael Cornwell <cornwell@acm.org>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -2076,7 +2076,6 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
       || options.smart_ext_selftest_log
       || options.sataphy
       || !options.log_requests.empty() ) {
-    PRINT_ON(con);
     if (isGeneralPurposeLoggingCapable(&drive))
       pout("General Purpose Logging (GPL) feature set supported\n");
 
@@ -2097,31 +2096,26 @@ int ataPrintMain (ata_device * device, const ata_print_options & options)
     // Read SMART Log directory
     if (need_smart_logdir) {
       if (ataReadLogDirectory(device, &smartlogdir_buf, false)){
-        PRINT_OFF(con);
         pout("Read SMART Log Directory failed.\n\n");
         failuretest(OPTIONAL_CMD, returnval|=FAILSMART);
       }
       else
         smartlogdir = &smartlogdir_buf;
     }
-    PRINT_ON(con);
 
     // Read GP Log directory
     if (need_gp_logdir) {
       if (ataReadLogDirectory(device, &gplogdir_buf, true)){
-        PRINT_OFF(con);
         pout("Read GP Log Directory failed.\n\n");
         failuretest(OPTIONAL_CMD, returnval|=FAILSMART);
       }
       else
         gplogdir = &gplogdir_buf;
     }
-    PRINT_ON(con);
 
     // Print log directories
     if ((options.gp_logdir && gplogdir) || (options.smart_logdir && smartlogdir))
       PrintLogDirectories(gplogdir, smartlogdir);
-    PRINT_OFF(con);
 
     // Print log pages
     for (i = 0; i < options.log_requests.size(); i++) {
-- 
GitLab