# HG changeset patch # User Michiel Broek # Date 1714842603 -7200 # Node ID 78744b7e602124a78ed76dee8fa2b36dde366bef # Parent 8289078ff7be641ec9a595c6b1d6ed955cdd2de9 Different gettid() test diff -r 8289078ff7be -r 78744b7e6021 configure --- a/configure Sat May 04 17:37:47 2024 +0200 +++ b/configure Sat May 04 19:10:03 2024 +0200 @@ -1680,51 +1680,72 @@ } # ac_fn_c_check_header_compile -# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES -# --------------------------------------------- -# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR -# accordingly. -ac_fn_c_check_decl () +# ac_fn_c_check_func LINENO FUNC VAR +# ---------------------------------- +# Tests whether FUNC exists, setting the cache variable VAR accordingly +ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - as_decl_name=`echo $2|sed 's/ *(.*//'` - as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'` - { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5 -$as_echo_n "checking whether $as_decl_name is declared... " >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ -$4 +/* Define $2 to an innocuous variant, in case declares $2. + For example, HP-UX 11i declares gettimeofday. */ +#define $2 innocuous_$2 + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $2 (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $2 + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $2 (); +/* 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_$2 || defined __stub___$2 +choke me +#endif + int main () { -#ifndef $as_decl_name -#ifdef __cplusplus - (void) $as_decl_use; -#else - (void) $as_decl_name; -#endif -#endif - +return $2 (); ; return 0; } _ACEOF -if ac_fn_c_try_compile "$LINENO"; then : +if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno -} # ac_fn_c_check_decl +} # ac_fn_c_check_func cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. @@ -3794,17 +3815,8 @@ fi LIBS="$LIBS -lm" -ac_fn_c_check_decl "$LINENO" "gettid" "ac_cv_have_decl_gettid" "$ac_includes_default" -if test "x$ac_cv_have_decl_gettid" = xyes; then : - ac_have_decl=1 -else - ac_have_decl=0 -fi - -cat >>confdefs.h <<_ACEOF -#define HAVE_DECL_GETTID $ac_have_decl -_ACEOF -if test $ac_have_decl = 1; then : +ac_fn_c_check_func "$LINENO" "gettid" "ac_cv_func_gettid" +if test "x$ac_cv_func_gettid" = xyes; then : result=yes else result=no diff -r 8289078ff7be -r 78744b7e6021 configure.ac --- a/configure.ac Sat May 04 17:37:47 2024 +0200 +++ b/configure.ac Sat May 04 19:10:03 2024 +0200 @@ -93,7 +93,7 @@ fi LIBS="$LIBS -lm" -AC_CHECK_DECLS(gettid,result=yes,result=no) +AC_CHECK_FUNC(gettid,result=yes,result=no) if test "$result" = "yes"; then AC_DEFINE(HAVE_GETTID) fi diff -r 8289078ff7be -r 78744b7e6021 thermferm/server.c --- a/thermferm/server.c Sat May 04 17:37:47 2024 +0200 +++ b/thermferm/server.c Sat May 04 19:10:03 2024 +0200 @@ -1783,7 +1783,6 @@ payload = NULL; return 0; } else { - syslog(LOG_NOTICE, "UNIT JSON %s", param); for (unit = Config.units; unit; unit = unit->next) { if (strcmp(param, unit->uuid) == 0) { srv_send(s, (char *)"213 Unit json data follows:");