diff --git a/src/common/rclconfig.cpp b/src/common/rclconfig.cpp index c026c5eb..5cb3c752 100644 --- a/src/common/rclconfig.cpp +++ b/src/common/rclconfig.cpp @@ -554,7 +554,9 @@ void RclConfig::storeMissingHelperDesc(const string &s) string fmiss = path_cat(getConfDir(), "missing"); FILE *fp = fopen(fmiss.c_str(), "w"); if (fp) { - fwrite(s.c_str(), s.size(), 1, fp); + if (fwrite(s.c_str(), s.size(), 1, fp) != 1) { + LOGERR(("storeMissingHelperDesc: fwrite failed\n")); + } fclose(fp); } } diff --git a/src/query/wasatorcl.cpp b/src/query/wasatorcl.cpp index b1941bc5..a49d1d58 100644 --- a/src/query/wasatorcl.cpp +++ b/src/query/wasatorcl.cpp @@ -20,6 +20,7 @@ static char rcsid[] = "@(#$Id: wasatorcl.cpp,v 1.18 2008-12-05 11:09:31 dockes E #include #include #include +#include using std::string; using std::list; diff --git a/src/rcldb/searchdata.cpp b/src/rcldb/searchdata.cpp index 5f2332f4..6ad55d75 100644 --- a/src/rcldb/searchdata.cpp +++ b/src/rcldb/searchdata.cpp @@ -19,6 +19,7 @@ static char rcsid[] = "@(#$Id: searchdata.cpp,v 1.32 2008-12-19 09:55:36 dockes */ // Handle translation from rcl's SearchData structures to Xapian Queries +#include #include #include diff --git a/src/utils/circache.cpp b/src/utils/circache.cpp index 2164114b..fcf2b16d 100644 --- a/src/utils/circache.cpp +++ b/src/utils/circache.cpp @@ -1011,7 +1011,9 @@ bool CirCache::put(const string& udi, const ConfSimple *iconf, if (writev(m_d->m_fd, vecs, 3) != nsize) { m_d->m_reason << "put: write failed. errno " << errno; if (extending) - ftruncate(m_d->m_fd, m_d->m_oheadoffs); + if (ftruncate(m_d->m_fd, m_d->m_oheadoffs) == -1) { + m_d->m_reason << "put: ftruncate failed. errno " << errno; + } return false; } diff --git a/src/utils/smallut.cpp b/src/utils/smallut.cpp index 7cdcf21f..e0e13128 100644 --- a/src/utils/smallut.cpp +++ b/src/utils/smallut.cpp @@ -27,6 +27,7 @@ static char rcsid[] = "@(#$Id: smallut.cpp,v 1.35 2008-11-19 10:06:49 dockes Exp #include #include #include +#include #include #include @@ -807,9 +808,13 @@ static bool addperiod(DateInterval *dp, DateInterval *pp) tm.tm_year = dp->y1 - 1900 + pp->y1; tm.tm_mon = dp->m1 + pp->m1 -1; tm.tm_mday = dp->d1 + pp->d1; +#ifdef sun + time_t tres = mktime(&tm); + localtime_r(&tres, &tm); +#else time_t tres = timegm(&tm); - // Convert back to normalized tm, then output gmtime_r(&tres, &tm); +#endif dp->y1 = tm.tm_year + 1900; dp->m1 = tm.tm_mon + 1; dp->d1 = tm.tm_mday;