appargs.cpp | 1 + appinst.h | 1 + incroncfg.cpp | 2 +- incroncfg.h | 1 + incrontab.cpp | 13 ++++++++++++- inotify-cxx.h | 1 + 6 files changed, 17 insertions(+), 2 deletions(-) diff --git a/appargs.cpp b/appargs.cpp index 3bac9b7..ac238b2 100644 --- a/appargs.cpp +++ b/appargs.cpp @@ -21,6 +21,7 @@ #include +#include #include "strtok.h" diff --git a/appinst.h b/appinst.h index d5f2cbe..bdbc8e7 100644 --- a/appinst.h +++ b/appinst.h @@ -23,6 +23,7 @@ #include +#include #define APPLOCK_BASEDIR "/var/run" diff --git a/incroncfg.cpp b/incroncfg.cpp index 6ff4d76..54fcfc5 100644 --- a/incroncfg.cpp +++ b/incroncfg.cpp @@ -181,7 +181,7 @@ bool IncronCfg::ParseLine(const char* s, std::string& rKey, std::string& rVal) bool IncronCfg::IsComment(const char* s) { - char* sx = strchr(s, '#'); + const char* sx = strchr(s, '#'); if (sx == NULL) return false; diff --git a/incroncfg.h b/incroncfg.h index 5d2c5b2..12aaf7d 100644 --- a/incroncfg.h +++ b/incroncfg.h @@ -19,6 +19,7 @@ #include +#include #include /// Configuration class. diff --git a/incrontab.cpp b/incrontab.cpp index 7077df7..757c62e 100644 --- a/incrontab.cpp +++ b/incrontab.cpp @@ -87,15 +87,24 @@ bool IncronTabEntry::Parse(const std::string& rStr, IncronTabEntry& rEntry) StringTokenizer tok(rStr, ' ', '\\'); if (!tok.HasMoreTokens()) + { +// fprintf(stderr,"Invalid table format\n"); return false; + } s1 = tok.GetNextToken(true); if (!tok.HasMoreTokens()) + { +// fprintf(stderr,"Invalid table format\n"); return false; + } s2 = tok.GetNextToken(true); if (!tok.HasMoreTokens()) + { +// fprintf(stderr,"Invalid table format\n"); return false; + } tok.SetNoPrefix(); s3 = tok.GetRemainder(); @@ -170,8 +179,10 @@ bool IncronTab::Save(const std::string& rPath) { FILE* f = fopen(rPath.c_str(), "w"); if (f == NULL) + { + fprintf(stderr,"cannot save\n"); return false; - + } std::deque::iterator it = m_tab.begin(); while (it != m_tab.end()) { fputs((*it).ToString().c_str(), f); diff --git a/inotify-cxx.h b/inotify-cxx.h index bb3a0e6..d270f9c 100644 --- a/inotify-cxx.h +++ b/inotify-cxx.h @@ -28,6 +28,7 @@ #include #include +#include #include #include