small compilation issues on misc systems
This commit is contained in:
parent
71c4a54ef4
commit
4385dd1b8b
@ -554,7 +554,9 @@ void RclConfig::storeMissingHelperDesc(const string &s)
|
|||||||
string fmiss = path_cat(getConfDir(), "missing");
|
string fmiss = path_cat(getConfDir(), "missing");
|
||||||
FILE *fp = fopen(fmiss.c_str(), "w");
|
FILE *fp = fopen(fmiss.c_str(), "w");
|
||||||
if (fp) {
|
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);
|
fclose(fp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,6 +20,7 @@ static char rcsid[] = "@(#$Id: wasatorcl.cpp,v 1.18 2008-12-05 11:09:31 dockes E
|
|||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
#include <algorithm>
|
||||||
using std::string;
|
using std::string;
|
||||||
using std::list;
|
using std::list;
|
||||||
|
|
||||||
|
|||||||
@ -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
|
// Handle translation from rcl's SearchData structures to Xapian Queries
|
||||||
|
#include <stdio.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|||||||
@ -1011,7 +1011,9 @@ bool CirCache::put(const string& udi, const ConfSimple *iconf,
|
|||||||
if (writev(m_d->m_fd, vecs, 3) != nsize) {
|
if (writev(m_d->m_fd, vecs, 3) != nsize) {
|
||||||
m_d->m_reason << "put: write failed. errno " << errno;
|
m_d->m_reason << "put: write failed. errno " << errno;
|
||||||
if (extending)
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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/time.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
@ -807,9 +808,13 @@ static bool addperiod(DateInterval *dp, DateInterval *pp)
|
|||||||
tm.tm_year = dp->y1 - 1900 + pp->y1;
|
tm.tm_year = dp->y1 - 1900 + pp->y1;
|
||||||
tm.tm_mon = dp->m1 + pp->m1 -1;
|
tm.tm_mon = dp->m1 + pp->m1 -1;
|
||||||
tm.tm_mday = dp->d1 + pp->d1;
|
tm.tm_mday = dp->d1 + pp->d1;
|
||||||
|
#ifdef sun
|
||||||
|
time_t tres = mktime(&tm);
|
||||||
|
localtime_r(&tres, &tm);
|
||||||
|
#else
|
||||||
time_t tres = timegm(&tm);
|
time_t tres = timegm(&tm);
|
||||||
// Convert back to normalized tm, then output
|
|
||||||
gmtime_r(&tres, &tm);
|
gmtime_r(&tres, &tm);
|
||||||
|
#endif
|
||||||
dp->y1 = tm.tm_year + 1900;
|
dp->y1 = tm.tm_year + 1900;
|
||||||
dp->m1 = tm.tm_mon + 1;
|
dp->m1 = tm.tm_mon + 1;
|
||||||
dp->d1 = tm.tm_mday;
|
dp->d1 = tm.tm_mday;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user