X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=test%2Fapi%2Ft15.c;h=b8a8171301168449f0886242ba906ca4e1837ea2;hb=131e8143a9b8da294d582f0793833679101a2672;hp=99b2a63ef7312708f9efef00a0f869a61b37bb24;hpb=4478d785b7769691261005c98063b98a5a5971b3;p=idzebra-moved-to-github.git diff --git a/test/api/t15.c b/test/api/t15.c index 99b2a63..b8a8171 100644 --- a/test/api/t15.c +++ b/test/api/t15.c @@ -1,5 +1,5 @@ -/* $Id: t15.c,v 1.7 2006-08-14 10:40:22 adam Exp $ - Copyright (C) 2004-2006 +/* $Id: t15.c,v 1.12 2007-01-15 15:10:20 adam Exp $ + Copyright (C) 2004-2007 Index Data ApS This file is part of the Zebra server. @@ -32,6 +32,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" @@ -42,7 +47,6 @@ static void update_process(ZebraService zs, int iter) { const char *rec = "some"; ZebraHandle zh = zebra_open(zs, 0); - // printf("update_record i=%d\n", i); zebra_add_record(zh, rec, strlen(rec)); if ((i % 30) == 0 || i == iter-1) zebra_commit(zh); @@ -109,23 +113,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)); }