X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Fapi%2Ft15.c;h=b0e93ad5f2335b51f25bc99cb6c0c78a114ef1f6;hb=97a7adeb9e5059463f039495cc01cfa448463a27;hp=01300ba647bcf69b5e424d25c76e0067eb48ce21;hpb=8b409b87708f39dffe49d5e85b8f7c0be29d02a3;p=idzebra-moved-to-github.git diff --git a/test/api/t15.c b/test/api/t15.c index 01300ba..b0e93ad 100644 --- a/test/api/t15.c +++ b/test/api/t15.c @@ -1,8 +1,5 @@ -/* $Id: t15.c,v 1.8 2006-09-20 19:29:25 adam Exp $ - Copyright (C) 2004-2006 - Index Data ApS - -This file is part of the Zebra server. +/* This file is part of the Zebra server. + Copyright (C) 1995-2008 Index Data Zebra is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -32,6 +29,11 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #if HAVE_SYS_WAIT_H #include #endif +#if HAVE_SYS_UTSNAME_H +#include +#endif + +#include #include "testlib.h" @@ -108,23 +110,36 @@ static void tst(int argc, char **argv) #if HAVE_SYS_WAIT_H #if HAVE_UNISTD_H +#if HAVE_SYS_UTSNAME_H + if (1) { + int tst_with_fork = 1; int status[3]; pid_t pids[3]; - - pids[0] = fork_service(zs, 200, search_process); - pids[1] = fork_service(zs, 20, update_process); - pids[2] = fork_service(zs, 20, update_process); - waitpid(pids[0], &status[0], 0); - YAZ_CHECK(status[0] == 0); - waitpid(pids[1], &status[1], 0); - YAZ_CHECK(status[1] == 0); - waitpid(pids[2], &status[2], 0); - YAZ_CHECK(status[2] == 0); + struct utsname s; + uname(&s); + if (!strcmp(s.sysname, "FreeBSD")) + tst_with_fork = 0; + + yaz_log(YLOG_LOG, "s.sysname=%s tst_with_fork=%d", s.sysname, + tst_with_fork); + if (tst_with_fork) + { + pids[0] = fork_service(zs, 200, search_process); + pids[1] = fork_service(zs, 20, update_process); + pids[2] = fork_service(zs, 20, update_process); + waitpid(pids[0], &status[0], 0); + YAZ_CHECK(status[0] == 0); + waitpid(pids[1], &status[1], 0); + YAZ_CHECK(status[1] == 0); + waitpid(pids[2], &status[2], 0); + YAZ_CHECK(status[2] == 0); + } } #endif #endif +#endif YAZ_CHECK(tl_close_down(0, zs)); }