small compilation issues on misc systems

This commit is contained in:
Jean-Francois Dockes 2010-09-13 21:34:23 +02:00
parent 71c4a54ef4
commit 4385dd1b8b
5 changed files with 14 additions and 3 deletions

View File

@ -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);
}
}

View File

@ -20,6 +20,7 @@ static char rcsid[] = "@(#$Id: wasatorcl.cpp,v 1.18 2008-12-05 11:09:31 dockes E
#include <cstdio>
#include <string>
#include <list>
#include <algorithm>
using std::string;
using std::list;

View File

@ -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 <stdio.h>
#include <string>
#include <vector>

View File

@ -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;
}

View File

@ -27,6 +27,7 @@ static char rcsid[] = "@(#$Id: smallut.cpp,v 1.35 2008-11-19 10:06:49 dockes Exp
#include <sys/time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <string.h>
#include <string>
#include <iostream>
@ -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;