-/* $Id: t15.c,v 1.6 2006-08-10 08:44:45 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.
for more details.
You should have received a copy of the GNU General Public License
-along with Zebra; see the file LICENSE.zebra. If not, write to the
-Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-02111-1307, USA.
+along with this program; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
*/
#if HAVE_SYS_STAT_H
#if HAVE_SYS_WAIT_H
#include <sys/wait.h>
#endif
+#if HAVE_SYS_UTSNAME_H
+#include <sys/utsname.h>
+#endif
+
+#include <string.h>
#include "testlib.h"
{
const char *rec = "<gils><title>some</title></gils>";
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);
#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));
}