From 3ff3135802464d335650e930ca63c544e2eece20 Mon Sep 17 00:00:00 2001 From: Rich Megginson Date: Jan 30 2008 17:16:45 +0000 Subject: fix build issues and compiler warnings on HP-UX --- diff --git a/Makefile.am b/Makefile.am index 843b57c..41fe93f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -205,7 +205,7 @@ MOSTLYCLEANFILES = dsgw.conf root.res dsgw.properties setup dsgw-httpd.conf en.r if WINNT ICU_GENRB = @icu_bin@/genrb.exe else -ICU_GENRB = sh $(srcdir)/genrb_wrapper.sh @icu_bin@ @icu_lib@ +ICU_GENRB = sh $(srcdir)/genrb_wrapper.sh @icu_bin@ @icu_libdir@ endif # The root resource bundle is based on English (en) locale; diff --git a/Makefile.in b/Makefile.in index ab2107c..5244750 100644 --- a/Makefile.in +++ b/Makefile.in @@ -504,7 +504,7 @@ nodist_bin_SCRIPTS = setup-ds-dsgw # add more here for localized bundles nodist_property_DATA = root.res en.res en_US.res MOSTLYCLEANFILES = dsgw.conf root.res dsgw.properties setup dsgw-httpd.conf en.res en_US.res -@WINNT_FALSE@ICU_GENRB = sh $(srcdir)/genrb_wrapper.sh @icu_bin@ @icu_lib@ +@WINNT_FALSE@ICU_GENRB = sh $(srcdir)/genrb_wrapper.sh @icu_bin@ @icu_libdir@ # Resource Bundle Compiler @WINNT_TRUE@ICU_GENRB = @icu_bin@/genrb.exe diff --git a/cgiutil.c b/cgiutil.c index c90d5b4..31ae62d 100644 --- a/cgiutil.c +++ b/cgiutil.c @@ -138,7 +138,7 @@ dsgw_vec_convert (char** vec) int dsgw_post_begin(FILE *in) { - char *ct, *tmp = NULL; + char *ct = NULL, *tmp = NULL; char **vars = NULL; if (( ct = getenv( "CONTENT_TYPE" )) == NULL || @@ -354,7 +354,7 @@ dsgw_convert( *pErrorCode = U_ZERO_ERROR; - if(sourceSize<0 || source==NULL || nDest==NULL || nSource==NULL) + if(source==NULL || nDest==NULL || nSource==NULL) { *pErrorCode=U_ILLEGAL_ARGUMENT_ERROR; return -1; diff --git a/config.h.in b/config.h.in index d108d71..0ab316d 100644 --- a/config.h.in +++ b/config.h.in @@ -214,6 +214,9 @@ /* Define to 1 if your declares `struct tm'. */ #undef TM_IN_SYS_TIME +/* use lockf instead of flock */ +#undef USE_LOCKF + /* Version number of package */ #undef VERSION diff --git a/configure b/configure index 76e9a93..458267d 100755 --- a/configure +++ b/configure @@ -21059,6 +21059,106 @@ fi done +# check for lockf +echo "$as_me:$LINENO: checking for lockf" >&5 +echo $ECHO_N "checking for lockf... $ECHO_C" >&6 +if test "${ac_cv_func_lockf+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define lockf to an innocuous variant, in case declares lockf. + For example, HP-UX 11i declares gettimeofday. */ +#define lockf innocuous_lockf + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char lockf (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef lockf + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char lockf (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_lockf) || defined (__stub___lockf) +choke me +#else +char (*f) () = lockf; +#endif +#ifdef __cplusplus +} +#endif + +int +main () +{ +return f != lockf; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_lockf=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_func_lockf=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_lockf" >&5 +echo "${ECHO_T}$ac_cv_func_lockf" >&6 +if test $ac_cv_func_lockf = yes; then + +cat >>confdefs.h <<\_ACEOF +#define USE_LOCKF 1 +_ACEOF + +fi + + PACKAGE_BASE_NAME=`echo $PACKAGE_NAME | sed -e s/-gw//` diff --git a/configure.ac b/configure.ac index ceb030b..7cbd8a8 100644 --- a/configure.ac +++ b/configure.ac @@ -59,6 +59,9 @@ AC_FUNC_STRTOD AC_FUNC_VPRINTF AC_CHECK_FUNCS([ftruncate getcwd isascii localtime_r memmove memset select strcasecmp strchr strdup strerror strncasecmp strpbrk strrchr strstr strtoul]) +# check for lockf +AC_CHECK_FUNC([lockf], [AC_DEFINE([USE_LOCKF], [1], [use lockf instead of flock])]) + PACKAGE_BASE_NAME=`echo $PACKAGE_NAME | sed -e s/-gw//` AC_SUBST(PACKAGE_BASE_NAME) diff --git a/entrydisplay.c b/entrydisplay.c index 7ebbb75..6fde186 100644 --- a/entrydisplay.c +++ b/entrydisplay.c @@ -2215,7 +2215,7 @@ url_display( struct dsgw_attrdispinfo *adip ) static void bool_display( struct dsgw_attrdispinfo *adip ) { - int boolval, free_onclick, pre_idx; + int boolval, pre_idx; char *usestr, *truestr, *falsestr, *checked; char *nameprefix, *onclick; @@ -2227,7 +2227,6 @@ bool_display( struct dsgw_attrdispinfo *adip ) if (( adip->adi_opts & DSGW_ATTROPT_EDITABLE ) == 0 ) { nameprefix = onclick = ""; - free_onclick = 0; } else { char *onclickfmt = " onClick=\"aChg('%s')\""; @@ -2241,7 +2240,6 @@ bool_display( struct dsgw_attrdispinfo *adip ) onclick = dsgw_ch_malloc( strlen( onclickfmt ) + strlen( adip->adi_attr ) + 1 ); sprintf( onclick, onclickfmt, adip->adi_attr ); - free_onclick = 1; } if (( truestr = get_arg_by_name( DSGW_ATTRARG_TRUESTR, adip->adi_argc,