fix build errors with newer gcc in incron

From: Mike Frysinger <vapier_at_gentoo.org>
Date: Sun, 1 Nov 2009 17:08:26 -0400

need to explicitly include fstream for fopen/etc... funcs, and strchr returns
a const which cant be simply assigned to non-const storage.

--- inotify-cxx.cpp (revision 102)
+++ inotify-cxx.cpp (working copy)
@@ -20,6 +20,7 @@
  */
  
 
+#include <fstream>
 #include <errno.h>
 #include <unistd.h>
 #include <fcntl.h>
--- icd-main.cpp (revision 102)
+++ icd-main.cpp (working copy)
@@ -13,6 +13,7 @@
  *
  */
 
+#include <fstream>
 #include <map>
 #include <signal.h>
 #include <wait.h>
--- appargs.cpp (revision 102)
+++ appargs.cpp (working copy)
@@ -20,6 +20,7 @@
  */
 
 
+#include <fstream>
 #include <cstring>
 
 #include "strtok.h"
--- usertable.cpp (revision 102)
+++ usertable.cpp (working copy)
@@ -27,6 +27,7 @@
 #include <stdlib.h>
 #include <sys/stat.h>
 #include <cstring>
+#include <fstream>
 
 #include "usertable.h"
 #include "incroncfg.h"

--- incroncfg.cpp (revision 102)
+++ incroncfg.cpp (working copy)
@@ -181,7 +181,7 @@ bool IncronCfg::ParseLine(const char* s,
 
 bool IncronCfg::IsComment(const char* s)
 {
- char* sx = strchr(s, '#');
+ const char* sx = strchr(s, '#');
   if (sx == NULL)
     return false;
     
-mike

Received on Tue Jun 05 2012 - 22:14:21 CEST

This archive was generated by hypermail 2.2.0 : Tue Jun 05 2012 - 22:14:21 CEST