]> git.proxmox.com Git - mirror_smartmontools-debian.git/blobdiff - dev_interface.cpp
Imported Upstream version 5.42+svn3521
[mirror_smartmontools-debian.git] / dev_interface.cpp
index 8b800fa7c03671d6104a2702a3b7f0276eaf842a..da2ccb779d868f8e38f805a97744b31a1388a8e8 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Home page of code is: http://smartmontools.sourceforge.net
  *
- * Copyright (C) 2008-11 Christian Franke <smartmontools-support@lists.sourceforge.net>
+ * Copyright (C) 2008-12 Christian Franke <smartmontools-support@lists.sourceforge.net>
  *
  * 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
@@ -25,7 +25,7 @@
 #include <stdarg.h>
 #include <stdexcept>
 
-const char * dev_interface_cpp_cvsid = "$Id: dev_interface.cpp 3256 2011-02-08 22:13:41Z chrfranke $"
+const char * dev_interface_cpp_cvsid = "$Id: dev_interface.cpp 3519 2012-03-06 20:01:44Z chrfranke $"
   DEV_INTERFACE_H_CVSID;
 
 /////////////////////////////////////////////////////////////////////////////
@@ -61,8 +61,7 @@ bool smart_device::set_err(int no, const char * msg, ...)
 
 bool smart_device::set_err(int no)
 {
-  smi()->set_err_var(&m_err, no);
-  return false;
+  return smi()->set_err_var(&m_err, no);
 }
 
 smart_device * smart_device::autodetect_open()
@@ -230,7 +229,7 @@ std::string smart_interface::get_valid_dev_types_str()
 {
   // default
   std::string s =
-    "ata, scsi, sat[,N][+TYPE], usbcypress[,X], usbjmicron[,x][,N], usbsunplus";
+    "ata, scsi, sat[,auto][,N][+TYPE], usbcypress[,X], usbjmicron[,x][,N], usbsunplus";
   // append custom
   std::string s2 = get_valid_custom_dev_types_str();
   if (!s2.empty()) {
@@ -244,28 +243,34 @@ std::string smart_interface::get_app_examples(const char * /*appname*/)
   return "";
 }
 
-void smart_interface::set_err(int no, const char * msg, ...)
+bool smart_interface::disable_system_auto_standby(bool /*disable*/)
 {
-  if (!msg) {
-    set_err(no); return;
-  }
+  return set_err(ENOSYS);
+}
+
+bool smart_interface::set_err(int no, const char * msg, ...)
+{
+  if (!msg)
+    return set_err(no);
   m_err.no = no;
   va_list ap; va_start(ap, msg);
   m_err.msg = vstrprintf(msg, ap);
   va_end(ap);
+  return false;
 }
 
-void smart_interface::set_err(int no)
+bool smart_interface::set_err(int no)
 {
-  set_err_var(&m_err, no);
+  return set_err_var(&m_err, no);
 }
 
-void smart_interface::set_err_var(smart_device::error_info * err, int no)
+bool smart_interface::set_err_var(smart_device::error_info * err, int no)
 {
   err->no = no;
   err->msg = get_msg_for_errno(no);
   if (err->msg.empty() && no != 0)
     err->msg = strprintf("Unknown error %d", no);
+  return false;
 }
 
 const char * smart_interface::get_msg_for_errno(int no)