From 7f9752358eb1c926c7a54a668493f2f5e5b03f60 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Thu, 23 Nov 2006 21:34:22 +0000 Subject: [PATCH] Omit test with multiple processes and update on FreeBSD. Bug #733. --- test/api/t15.c | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/test/api/t15.c b/test/api/t15.c index 01300ba..da68b0d 100644 --- a/test/api/t15.c +++ b/test/api/t15.c @@ -1,4 +1,4 @@ -/* $Id: t15.c,v 1.8 2006-09-20 19:29:25 adam Exp $ +/* $Id: t15.c,v 1.9 2006-11-23 21:34:22 adam Exp $ Copyright (C) 2004-2006 Index Data ApS @@ -33,6 +33,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #include #endif +#include + #include "testlib.h" static void update_process(ZebraService zs, int iter) @@ -108,20 +110,31 @@ static void tst(int argc, char **argv) #if HAVE_SYS_WAIT_H #if HAVE_UNISTD_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 -- 1.7.10.4