~brianaker/libmemcached/1220444

« back to all changes in this revision

Viewing changes to libtest/has.cc

  • Committer: Continuous Integration
  • Date: 2013-05-03 20:01:41 UTC
  • mfrom: (1161.1.22 libmemcached-1.0)
  • Revision ID: ci@tangent.org-20130503200141-2ikpkgqc50mo5hte
Merge lp:~tangent-org/libmemcached/1.0-build/ Build: jenkins-Libmemcached-296

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
 
46
46
bool has_libmemcached_sasl(void)
47
47
{
48
 
#if defined(LIBMEMCACHED_WITH_SASL_SUPPORT) && LIBMEMCACHED_WITH_SASL_SUPPORT
49
 
  if (LIBMEMCACHED_WITH_SASL_SUPPORT)
50
 
  {
51
 
    return true;
52
 
  }
53
 
#endif
54
 
 
55
48
  return false;
56
49
}
57
50
 
192
185
{
193
186
  initialize_memcached_binary();
194
187
 
195
 
  if (memcached_binary_path[0])
196
188
  if (memcached_binary_path[0] and (strlen(memcached_binary_path) > 0))
197
189
  {
198
190
    return true;
213
205
  return NULL;
214
206
}
215
207
 
216
 
static char memcached_sasl_binary_path[FILENAME_MAX];
217
 
 
218
 
static void initialize_has_memcached_sasl()
219
 
{
220
 
  memcached_sasl_binary_path[0]= 0;
221
 
 
222
 
#if defined(MEMCACHED_BINARY) &&  defined(HAVE_MEMCACHED_BINARY) && HAVE_MEMCACHED_BINARY
223
 
  if (HAVE_MEMCACHED_BINARY)
224
 
  {
225
 
    std::stringstream arg_buffer;
226
 
 
227
 
    char *getenv_ptr;
228
 
    if (bool((getenv_ptr= getenv("PWD"))) and strcmp(MEMCACHED_BINARY, "memcached/memcached") == 0)
229
 
    {
230
 
      arg_buffer << getenv_ptr;
231
 
      arg_buffer << "/";
232
 
    }
233
 
    arg_buffer << MEMCACHED_BINARY;
234
 
 
235
 
    if (access(arg_buffer.str().c_str(), X_OK) == 0)
236
 
    {
237
 
      strncpy(memcached_sasl_binary_path, arg_buffer.str().c_str(), FILENAME_MAX);
238
 
    }
239
 
  }
240
 
#endif
241
 
}
242
 
 
243
 
bool has_memcached_sasl()
244
 
{
245
 
  initialize_has_memcached_sasl();
246
 
 
247
 
  if (memcached_sasl_binary_path[0] and (strlen(memcached_sasl_binary_path) > 0))
248
 
  {
249
 
    return true;
250
 
  }
251
 
 
252
 
  return false;
253
 
}
254
 
 
255
208
const char *gearmand_binary() 
256
209
{
257
210
#if defined(GEARMAND_BINARY)