From: Adam Dickmeiss Date: Tue, 14 Jun 2005 20:28:53 +0000 (+0000) Subject: Use HAVE_UNISTD_H when including unistd.h. X-Git-Tag: before.bug.529~389 X-Git-Url: http://git.indexdata.com/?p=idzebra-moved-to-github.git;a=commitdiff_plain;h=47eeb5384a8fae8bcac8afb8a84782ca094683f9 Use HAVE_UNISTD_H when including unistd.h. --- diff --git a/bfile/bfile.c b/bfile/bfile.c index ab5fa6c..99b98fc 100644 --- a/bfile/bfile.c +++ b/bfile/bfile.c @@ -1,4 +1,4 @@ -/* $Id: bfile.c,v 1.43 2005-05-17 08:50:48 adam Exp $ +/* $Id: bfile.c,v 1.44 2005-06-14 20:28:53 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -26,7 +26,9 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #ifdef WIN32 #include -#else +#endif + +#if HAVE_UNISTD_H #include #endif diff --git a/bfile/mfile.c b/bfile/mfile.c index ecd795d..ce4279a 100644 --- a/bfile/mfile.c +++ b/bfile/mfile.c @@ -1,4 +1,4 @@ -/* $Id: mfile.c,v 1.61 2005-05-17 08:50:48 adam Exp $ +/* $Id: mfile.c,v 1.62 2005-06-14 20:28:53 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -32,7 +32,8 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #ifdef WIN32 #include -#else +#endif +#if HAVE_UNISTD_H #include #endif #include diff --git a/dfa/agrep.c b/dfa/agrep.c index 179a495..71e7b37 100644 --- a/dfa/agrep.c +++ b/dfa/agrep.c @@ -1,4 +1,4 @@ -/* $Id: agrep.c,v 1.15 2005-03-30 09:25:23 adam Exp $ +/* $Id: agrep.c,v 1.16 2005-06-14 20:28:53 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -32,10 +32,9 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #ifdef WIN32 - #include - -#else +#endif +#if HAVE_UNISTD_H #include #endif diff --git a/dict/dopen.c b/dict/dopen.c index 47b9304..80f80e8 100644 --- a/dict/dopen.c +++ b/dict/dopen.c @@ -1,4 +1,4 @@ -/* $Id: dopen.c,v 1.11 2005-01-15 19:38:21 adam Exp $ +/* $Id: dopen.c,v 1.12 2005-06-14 20:28:53 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -24,7 +24,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #include -#ifndef WIN32 +#if HAVE_UNISTD_H #include #endif #include diff --git a/dict/drdwr.c b/dict/drdwr.c index a77335f..463b941 100644 --- a/dict/drdwr.c +++ b/dict/drdwr.c @@ -1,4 +1,4 @@ -/* $Id: drdwr.c,v 1.16 2005-01-15 19:38:21 adam Exp $ +/* $Id: drdwr.c,v 1.17 2005-06-14 20:28:53 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -24,7 +24,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #include -#ifndef WIN32 +#if HAVE_UNISTD_H #include #endif #include diff --git a/index/dir.c b/index/dir.c index 41b7f1b..dc56847 100644 --- a/index/dir.c +++ b/index/dir.c @@ -1,4 +1,4 @@ -/* $Id: dir.c,v 1.30 2005-01-15 19:38:24 adam Exp $ +/* $Id: dir.c,v 1.31 2005-06-14 20:28:53 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -24,7 +24,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #include #include -#ifndef WIN32 +#if HAVE_UNISTD_H #include #endif #include diff --git a/index/extract.c b/index/extract.c index acd63b2..de6aa9e 100644 --- a/index/extract.c +++ b/index/extract.c @@ -1,4 +1,4 @@ -/* $Id: extract.c,v 1.185 2005-06-07 14:53:39 adam Exp $ +/* $Id: extract.c,v 1.186 2005-06-14 20:28:54 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -25,7 +25,8 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #ifdef WIN32 #include -#else +#endif +#if HAVE_UNISTD_H #include #endif #include diff --git a/index/kdump.c b/index/kdump.c index 3ce82fd..c899eda 100644 --- a/index/kdump.c +++ b/index/kdump.c @@ -1,4 +1,4 @@ -/* $Id: kdump.c,v 1.28 2005-01-15 19:38:26 adam Exp $ +/* $Id: kdump.c,v 1.29 2005-06-14 20:28:54 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -25,7 +25,8 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #ifdef WIN32 #include -#else +#endif +#if HAVE_UNISTD_H #include #endif #include diff --git a/index/kinput.c b/index/kinput.c index cc464c2..23d9366 100644 --- a/index/kinput.c +++ b/index/kinput.c @@ -1,4 +1,4 @@ -/* $Id: kinput.c,v 1.65 2005-04-13 13:03:47 adam Exp $ +/* $Id: kinput.c,v 1.66 2005-06-14 20:28:54 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -23,7 +23,8 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #ifdef WIN32 #include -#else +#endif +#if HAVE_UNISTD_H #include #endif #include diff --git a/index/lockidx.c b/index/lockidx.c index 423ca72..b00d251 100644 --- a/index/lockidx.c +++ b/index/lockidx.c @@ -1,4 +1,4 @@ -/* $Id: lockidx.c,v 1.24 2005-01-15 19:38:26 adam Exp $ +/* $Id: lockidx.c,v 1.25 2005-06-14 20:28:54 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -25,7 +25,8 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #ifdef WIN32 #include -#else +#endif +#if HAVE_UNISTD_H #include #endif #include diff --git a/index/locksrv.c b/index/locksrv.c index 98f4b22..0140718 100644 --- a/index/locksrv.c +++ b/index/locksrv.c @@ -1,4 +1,4 @@ -/* $Id: locksrv.c,v 1.19 2005-01-15 19:38:26 adam Exp $ +/* $Id: locksrv.c,v 1.20 2005-06-14 20:28:54 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -25,7 +25,8 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #ifdef WIN32 #include -#else +#endif +#if HAVE_UNISTD_H #include #endif #include diff --git a/index/lockutil.c b/index/lockutil.c index 96b69d3..4c7cbf7 100644 --- a/index/lockutil.c +++ b/index/lockutil.c @@ -1,4 +1,4 @@ -/* $Id: lockutil.c,v 1.20 2005-01-15 19:38:26 adam Exp $ +/* $Id: lockutil.c,v 1.21 2005-06-14 20:28:54 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -30,7 +30,8 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #ifdef WIN32 #include #include -#else +#endif +#if HAVE_UNISTD_H #include #endif diff --git a/index/main.c b/index/main.c index 6038469..071e1ec 100644 --- a/index/main.c +++ b/index/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.124 2005-05-11 12:39:36 adam Exp $ +/* $Id: main.c,v 1.125 2005-06-14 20:28:54 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -26,8 +26,11 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #ifdef WIN32 #include -#else +#endif +#if HAVE_UNISTD_H #include +#endif +#if HAVE_SYS_TIME_H #include #endif #include @@ -65,9 +68,11 @@ int main (int argc, char **argv) int trans_started=0; #if HAVE_SYS_TIMES_H struct tms tms1, tms2; - struct timeval start_time, end_time; double usec; #endif +#if HAVE_SYS_TIME_H + struct timeval start_time, end_time; +#endif #ifndef WIN32 char nbuf[100]; #endif @@ -83,6 +88,8 @@ int main (int argc, char **argv) #endif #if HAVE_SYS_TIMES_H times(&tms1); +#endif +#if HAVE_SYS_TIME_H gettimeofday(&start_time, 0); #endif prog = *argv; @@ -279,6 +286,7 @@ int main (int argc, char **argv) zebra_close (zh); zebra_stop (zs); #if HAVE_SYS_TIMES_H +#if HAVE_SYS_TIME_H if (trans_started) { gettimeofday(&end_time, 0); @@ -291,6 +299,7 @@ int main (int argc, char **argv) (double) (tms2.tms_stime - tms1.tms_stime)/100); } #endif +#endif nmem_exit(); exit (0); return 0; diff --git a/index/rank1.c b/index/rank1.c index 029f5de..0b1ddfb 100644 --- a/index/rank1.c +++ b/index/rank1.c @@ -1,4 +1,4 @@ -/* $Id: rank1.c,v 1.24 2005-03-08 14:41:37 adam Exp $ +/* $Id: rank1.c,v 1.25 2005-06-14 20:28:54 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -24,7 +24,8 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #ifdef WIN32 #include -#else +#endif +#if HAVE_UNISTD_H #include #endif diff --git a/index/recstat.c b/index/recstat.c index c86d820..edab221 100644 --- a/index/recstat.c +++ b/index/recstat.c @@ -1,4 +1,4 @@ -/* $Id: recstat.c,v 1.13 2005-01-15 19:38:26 adam Exp $ +/* $Id: recstat.c,v 1.14 2005-06-14 20:28:54 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -25,7 +25,7 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #include #include -#ifndef WIN32 +#if HAVE_UNISTD_H #include #endif #include "recindxp.h" diff --git a/index/retrieve.c b/index/retrieve.c index 8dbe8a5..5cd2ec5 100644 --- a/index/retrieve.c +++ b/index/retrieve.c @@ -1,4 +1,4 @@ -/* $Id: retrieve.c,v 1.31 2005-06-07 11:36:38 adam Exp $ +/* $Id: retrieve.c,v 1.32 2005-06-14 20:28:54 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -27,7 +27,8 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #ifdef WIN32 #include #include -#else +#endif +#if HAVE_UNISTD_H #include #endif diff --git a/index/trav.c b/index/trav.c index 4d02b5e..3dff5f5 100644 --- a/index/trav.c +++ b/index/trav.c @@ -1,4 +1,4 @@ -/* $Id: trav.c,v 1.48 2005-05-09 19:57:35 adam Exp $ +/* $Id: trav.c,v 1.49 2005-06-14 20:28:54 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -27,7 +27,8 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #define S_ISREG(x) (x & _S_IFREG) #define S_ISDIR(x) (x & _S_IFDIR) -#else +#endif +#if HAVE_UNISTD_H #include #endif #include diff --git a/index/zebraapi.c b/index/zebraapi.c index 37d7399..1fbb956 100644 --- a/index/zebraapi.c +++ b/index/zebraapi.c @@ -1,4 +1,4 @@ -/* $Id: zebraapi.c,v 1.177 2005-06-13 10:29:20 adam Exp $ +/* $Id: zebraapi.c,v 1.178 2005-06-14 20:28:54 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -27,7 +27,8 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #include #include -#else +#endif +#if HAVE_UNISTD_H #include #endif diff --git a/index/zebrash.c b/index/zebrash.c index 928bf95..c9bbda4 100644 --- a/index/zebrash.c +++ b/index/zebrash.c @@ -1,4 +1,4 @@ -/* $Id: zebrash.c,v 1.33 2005-03-09 12:14:42 adam Exp $ +/* $Id: zebrash.c,v 1.34 2005-06-14 20:28:54 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -28,7 +28,9 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #include #include -#include /* for isatty */ +#if HAVE_UNISTD_H +#include +#endif #if HAVE_READLINE_READLINE_H #include diff --git a/index/zrpn.c b/index/zrpn.c index a928fa0..9927949 100644 --- a/index/zrpn.c +++ b/index/zrpn.c @@ -1,4 +1,4 @@ -/* $Id: zrpn.c,v 1.199 2005-06-14 12:42:48 adam Exp $ +/* $Id: zrpn.c,v 1.200 2005-06-14 20:28:54 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -24,7 +24,8 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #ifdef WIN32 #include -#else +#endif +#if HAVE_UNISTD_H #include #endif #include diff --git a/index/zserver.c b/index/zserver.c index e2ec1b3..00ef4df 100644 --- a/index/zserver.c +++ b/index/zserver.c @@ -1,4 +1,4 @@ -/* $Id: zserver.c,v 1.135 2005-06-13 10:29:20 adam Exp $ +/* $Id: zserver.c,v 1.136 2005-06-14 20:28:54 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -28,7 +28,8 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #include #include -#else +#endif +#if HAVE_UNISTD_H #include #endif diff --git a/rset/rstemp.c b/rset/rstemp.c index 3ad1422..338e697 100644 --- a/rset/rstemp.c +++ b/rset/rstemp.c @@ -1,4 +1,4 @@ -/* $Id: rstemp.c,v 1.64 2005-05-24 11:35:43 adam Exp $ +/* $Id: rstemp.c,v 1.65 2005-06-14 20:28:54 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -27,7 +27,8 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #ifdef WIN32 #include -#else +#endif +#if HAVE_UNISTD_H #include #endif #include diff --git a/test/api/testlib.c b/test/api/testlib.c index d80ab13..3d1f743 100644 --- a/test/api/testlib.c +++ b/test/api/testlib.c @@ -1,4 +1,4 @@ -/* $Id: testlib.c,v 1.22 2005-06-14 20:02:30 adam Exp $ +/* $Id: testlib.c,v 1.23 2005-06-14 20:28:54 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -22,8 +22,12 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA /** testlib - utilities for the api tests */ +#if HAVE_SYS_TIME_H #include +#endif +#if HAVE_SYS_RESOURCE_H #include +#endif #if HAVE_UNISTD_H #include #endif @@ -65,10 +69,14 @@ void start_log(int argc, char **argv) */ ZebraService start_up(char *cfgname, int argc, char **argv) { +#if HAVE_SYS_RESOURCE_H +#if HAVE_SYS_TIME_H struct rlimit rlim; rlim.rlim_cur = 20; rlim.rlim_max = 20; setrlimit(RLIMIT_CPU, &rlim); +#endif +#endif nmem_init(); start_log(argc, argv); return start_service(cfgname); diff --git a/util/res.c b/util/res.c index 4714c68..7f30b8c 100644 --- a/util/res.c +++ b/util/res.c @@ -1,4 +1,4 @@ -/* $Id: res.c,v 1.42 2005-06-13 10:27:52 adam Exp $ +/* $Id: res.c,v 1.43 2005-06-14 20:28:54 adam Exp $ Copyright (C) 1995-2005 Index Data ApS @@ -26,7 +26,8 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include #ifdef WIN32 #include -#else +#endif +#if HAVE_UNISTD_H #include #endif