/*
* smartctl.cpp
*
- * Home page of code is: http://smartmontools.sourceforge.net
+ * Home page of code is: http://www.smartmontools.org
*
* Copyright (C) 2002-11 Bruce Allen
* Copyright (C) 2008-15 Christian Franke
#include "smartctl.h"
#include "utility.h"
-const char * smartctl_cpp_cvsid = "$Id: smartctl.cpp 4080 2015-05-05 20:31:22Z chrfranke $"
+const char * smartctl_cpp_cvsid = "$Id: smartctl.cpp 4162 2015-10-31 16:36:16Z chrfranke $"
CONFIG_H_CVSID SMARTCTL_H_CVSID;
// Globals to control printing
opterr=optopt=0;
const char * type = 0; // set to -d optarg
- bool no_defaultdb = false; // set true on '-B FILE'
+ bool use_default_db = true; // set false on '-B FILE'
bool output_format_set = false; // set true on '-f FORMAT'
int scan = 0; // set by --scan, --scan-open
bool badarg = false, captive = false;
} else if (!strcmp(optarg, "show")) {
ataopts.show_presets = true;
} else if (!strcmp(optarg, "showall")) {
- if (!no_defaultdb && !read_default_drive_databases())
+ if (!init_drive_database(use_default_db))
EXIT(FAILCMD);
if (optind < argc) { // -P showall MODEL [FIRMWARE]
int cnt = showmatchingpresets(argv[optind], (optind+1<argc ? argv[optind+1] : NULL));
if (*path == '+' && path[1])
path++;
else
- no_defaultdb = true;
+ use_default_db = false;
if (!read_drive_database(path))
EXIT(FAILCMD);
}
// Special handling of --scan, --scanopen
if (scan) {
// Read or init drive database to allow USB ID check.
- if (!no_defaultdb && !read_default_drive_databases())
+ if (!init_drive_database(use_default_db))
EXIT(FAILCMD);
scan_devices(type, (scan == opt_scan_open), argv + optind);
EXIT(0);
}
// Read or init drive database
- if (!no_defaultdb && !read_default_drive_databases())
+ if (!init_drive_database(use_default_db))
EXIT(FAILCMD);
return type;