|
a/src/common/rclinit.cpp |
|
b/src/common/rclinit.cpp |
|
... |
|
... |
12 |
* You should have received a copy of the GNU General Public License
|
12 |
* You should have received a copy of the GNU General Public License
|
13 |
* along with this program; if not, write to the
|
13 |
* along with this program; if not, write to the
|
14 |
* Free Software Foundation, Inc.,
|
14 |
* Free Software Foundation, Inc.,
|
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
16 |
*/
|
16 |
*/
|
|
|
17 |
#include "autoconfig.h"
|
17 |
|
18 |
|
18 |
#include <stdio.h>
|
19 |
#include <stdio.h>
|
19 |
#include <signal.h>
|
20 |
#include <signal.h>
|
20 |
#include <locale.h>
|
21 |
#include <locale.h>
|
21 |
#include <pthread.h>
|
22 |
#include <pthread.h>
|
22 |
#include <cstdlib>
|
23 |
#include <cstdlib>
|
|
|
24 |
#if !defined(PUTENV_ARG_CONST)
|
|
|
25 |
#include <string.h>
|
|
|
26 |
#endif
|
23 |
|
27 |
|
24 |
#include "debuglog.h"
|
28 |
#include "debuglog.h"
|
25 |
#include "rclconfig.h"
|
29 |
#include "rclconfig.h"
|
26 |
#include "rclinit.h"
|
30 |
#include "rclinit.h"
|
27 |
#include "pathut.h"
|
31 |
#include "pathut.h"
|
|
... |
|
... |
94 |
|
98 |
|
95 |
// Make sure the locale charset is initialized (so that multiple
|
99 |
// Make sure the locale charset is initialized (so that multiple
|
96 |
// threads don't try to do it at once).
|
100 |
// threads don't try to do it at once).
|
97 |
config->getDefCharset();
|
101 |
config->getDefCharset();
|
98 |
|
102 |
|
|
|
103 |
int flushmb;
|
|
|
104 |
if (config->getConfParam("idxflushmb", &flushmb) && flushmb > 0) {
|
|
|
105 |
LOGDEB(("rclinit: idxflushmb=%d, set XAPIAN_FLUSH_THRESHOLD to 10E6\n",
|
|
|
106 |
flushmb));
|
|
|
107 |
static const char *cp = "XAPIAN_FLUSH_THRESHOLD=1000000";
|
|
|
108 |
#ifdef PUTENV_ARG_CONST
|
|
|
109 |
::putenv(cp);
|
|
|
110 |
#else
|
|
|
111 |
::putenv(strdup(cp));
|
|
|
112 |
#endif
|
|
|
113 |
}
|
|
|
114 |
|
99 |
return config;
|
115 |
return config;
|
100 |
}
|
116 |
}
|
101 |
|
117 |
|
102 |
// Signals are handled by the main thread. All others should call this routine
|
118 |
// Signals are handled by the main thread. All others should call this routine
|
103 |
// to block possible signals
|
119 |
// to block possible signals
|