From 108dd6195ab02b9764ed6292e748bf9a6623f53b Mon Sep 17 00:00:00 2001
From: dlukes <dlukes@4ea69e1a-61f1-4043-bf83-b5c94c648137>
Date: Fri, 30 Jan 2009 14:07:07 +0000
Subject: [PATCH] Make compilation less noisy

Based on Douglas Gilbert's notice:

smartd.cpp:740: warning: format not a string literal and no format arguments
smartd.cpp:1369: warning: ignoring return value of int dup(int)
smartd.cpp:1371: warning: ignoring return value of int dup(int)
smartd.cpp:1373: warning: ignoring return value of int chdir(const char*)
smartd.cpp:3742: warning: format not a string literal and no format arguments


git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@2722 4ea69e1a-61f1-4043-bf83-b5c94c648137
---
 sm5/smartd.cpp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/sm5/smartd.cpp b/sm5/smartd.cpp
index 2ba92c5c6..2339fbf54 100644
--- a/sm5/smartd.cpp
+++ b/sm5/smartd.cpp
@@ -138,7 +138,7 @@ extern const char *os_solaris_ata_s_cvsid;
 #ifdef _WIN32
 extern const char *daemon_win32_c_cvsid, *hostname_win32_c_cvsid, *syslog_win32_c_cvsid;
 #endif
-const char *smartd_c_cvsid="$Id: smartd.cpp,v 1.434 2008/11/04 21:00:38 chrfranke Exp $"
+const char *smartd_c_cvsid="$Id: smartd.cpp,v 1.435 2009/01/30 14:07:07 dlukes Exp $"
 ATACMDS_H_CVSID CONFIG_H_CVSID
 #ifdef DAEMON_WIN32_H_CVSID
 DAEMON_WIN32_H_CVSID
@@ -737,7 +737,7 @@ void PrintOneCVS(const char *a_cvs_id){
 void PrintCVS(void){
   const char *configargs=strlen(SMARTMONTOOLS_CONFIGURE_ARGS)?SMARTMONTOOLS_CONFIGURE_ARGS:"[no arguments given]";
 
-  PrintOut(LOG_INFO,(char *)copyleftstring);
+  PrintOut(LOG_INFO,"%s", (char *)copyleftstring);
   PrintOut(LOG_INFO,"CVS version IDs of files used to build this code are:\n");
   PrintOneCVS(atacmdnames_c_cvsid);
   PrintOneCVS(atacmds_c_cvsid);
@@ -1366,11 +1366,11 @@ void DaemonInit(){
   // redirect any IO attempts to /dev/null for stdin
   i=open("/dev/null",O_RDWR);
   // stdout
-  dup(i);
+  (void)dup(i);
   // stderr
-  dup(i);
+  (void)dup(i);
   umask(0);
-  chdir("/");
+  (void) chdir("/");
 
   if (do_fork)
     PrintOut(LOG_INFO, "smartd has fork()ed into background mode. New PID=%d.\n", (int)getpid());
@@ -3739,7 +3739,7 @@ void PrintValidArgs(char opt) {
   if (!(s = GetValidArgList(opt)))
     PrintOut(LOG_CRIT, "Error constructing argument list for option %c", opt);
   else
-    PrintOut(LOG_CRIT, (char *)s);
+    PrintOut(LOG_CRIT, "%s", (char *)s);
   PrintOut(LOG_CRIT, " <=======\n");
 }
 
-- 
GitLab