Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

various enhancement + some fix

  • Loading branch information...
commit 020a4c46a8595becedd65c75e2cd3a31887fc4ee 1 parent d23dffd
@stefanocasazza authored
Showing with 845 additions and 637 deletions.
  1. +2 −2 aclocal.m4
  2. +190 −173 configure
  3. +7 −2 configure.in
  4. +1 −1  examples/IR/update.cpp
  5. +1 −1  examples/WiAuth/wi_auth.cpp
  6. +1 −1  examples/WiAuth/wi_auth.usp
  7. +6 −0 include/ulib/command.h
  8. +18 −13 include/ulib/file.h
  9. +31 −14 include/ulib/log.h
  10. +4 −0 include/ulib/net/client/imap.h
  11. +4 −0 include/ulib/net/client/pop3.h
  12. +5 −1 include/ulib/net/client/smtp.h
  13. +4 −2 include/ulib/net/server/plugin/mod_nocat.h
  14. +5 −4 include/ulib/net/server/server.h
  15. +12 −4 include/ulib/process.h
  16. +1 −0  include/ulib/ssl/net/sslsocket.h
  17. +3 −3 include/ulib/timeval.h
  18. +5 −1 include/ulib/utility/dir_walk.h
  19. +33 −38 include/ulib/utility/semaphore.h
  20. +2 −2 src/ulib/cache.cpp
  21. +1 −3 src/ulib/db/rdb.cpp
  22. +69 −70 src/ulib/file.cpp
  23. +7 −1 src/ulib/internal/memory_pool.cpp
  24. +78 −52 src/ulib/log.cpp
  25. +13 −6 src/ulib/net/server/plugin/mod_nocat.cpp
  26. +36 −43 src/ulib/net/server/server.cpp
  27. +76 −10 src/ulib/ssl/net/sslsocket.cpp
  28. +10 −1 src/ulib/thread.cpp
  29. +60 −24 src/ulib/utility/dir_walk.cpp
  30. +17 −20 src/ulib/utility/semaphore.cpp
  31. +85 −100 src/ulib/utility/uhttp.cpp
  32. +1 −1  tests/examples/TSA/CA/tsaserial
  33. +10 −0 tests/examples/inp/http/all5.inp
  34. +1 −0  tests/examples/inp/http/all6.inp
  35. +31 −30 tests/examples/ok/client_server.ok
  36. +3 −3 tests/examples/web_server.cfg
  37. +7 −8 tests/examples/web_server.sh
  38. +3 −1 tests/examples/web_server.test
  39. BIN  tests/ulib/inp/test.db
  40. +1 −1  tests/ulib/smtp.test
  41. +1 −1  tests/ulib/test_smtp.cpp
View
4 aclocal.m4
@@ -14,8 +14,8 @@
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
-m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
-[m4_warning([this file was generated for autoconf 2.68.
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
+[m4_warning([this file was generated for autoconf 2.69.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
View
363 configure
@@ -1,13 +1,11 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.68 for ULib 1.1.0.
+# Generated by GNU Autoconf 2.69 for ULib 1.1.0.
#
# Report bugs to <stefano.casazza@gmail.com>.
#
#
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
-# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
-# Foundation, Inc.
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
#
#
# This configure script is free software; the Free Software Foundation
@@ -136,6 +134,31 @@ export LANGUAGE
# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+# Use a proper internal environment variable to ensure we don't fall
+ # into an infinite loop, continuously re-executing ourselves.
+ if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
+ _as_can_reexec=no; export _as_can_reexec;
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+as_fn_exit 255
+ fi
+ # We don't want this to propagate to other subprocesses.
+ { _as_can_reexec=; unset _as_can_reexec;}
if test "x$CONFIG_SHELL" = x; then
as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
@@ -169,7 +192,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
else
exitcode=1; echo positional parameters were not saved.
fi
-test x\$exitcode = x0 || exit 1"
+test x\$exitcode = x0 || exit 1
+test -x / || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
@@ -222,21 +246,25 @@ IFS=$as_save_IFS
if test "x$CONFIG_SHELL" != x; then :
- # We cannot yet assume a decent shell, so we have to provide a
- # neutralization value for shells without unset; and this also
- # works around shells that cannot unset nonexistent variables.
- # Preserve -v and -x to the replacement shell.
- BASH_ENV=/dev/null
- ENV=/dev/null
- (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
- export CONFIG_SHELL
- case $- in # ((((
- *v*x* | *x*v* ) as_opts=-vx ;;
- *v* ) as_opts=-v ;;
- *x* ) as_opts=-x ;;
- * ) as_opts= ;;
- esac
- exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+ export CONFIG_SHELL
+ # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# works around shells that cannot unset nonexistent variables.
+# Preserve -v and -x to the replacement shell.
+BASH_ENV=/dev/null
+ENV=/dev/null
+(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+case $- in # ((((
+ *v*x* | *x*v* ) as_opts=-vx ;;
+ *v* ) as_opts=-v ;;
+ *x* ) as_opts=-x ;;
+ * ) as_opts= ;;
+esac
+exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
+# Admittedly, this is quite paranoid, since all the known shells bail
+# out after a failed `exec'.
+$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
+exit 255
fi
if test x$as_have_required = xno; then :
@@ -339,6 +367,14 @@ $as_echo X"$as_dir" |
} # as_fn_mkdir_p
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
@@ -460,6 +496,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits
chmod +x "$as_me.lineno" ||
{ $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+ # If we had to re-execute with $CONFIG_SHELL, we're ensured to have
+ # already done that, so ensure we don't try to do so again and fall
+ # in an infinite loop. This has already happened in practice.
+ _as_can_reexec=no; export _as_can_reexec
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
@@ -494,16 +534,16 @@ if (echo >conf$$.file) 2>/dev/null; then
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
+ # In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
@@ -515,28 +555,8 @@ else
as_mkdir_p=false
fi
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in #(
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -1444,8 +1464,6 @@ target=$target_alias
if test "x$host_alias" != x; then
if test "x$build_alias" = x; then
cross_compiling=maybe
- $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
- If a cross compiler is detected then cross compile mode will be used" >&2
elif test "x$build_alias" != "x$host_alias"; then
cross_compiling=yes
fi
@@ -1758,9 +1776,9 @@ test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
ULib configure 1.1.0
-generated by GNU Autoconf 2.68
+generated by GNU Autoconf 2.69
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
This configure script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it.
_ACEOF
@@ -2112,7 +2130,7 @@ $as_echo "$ac_try_echo"; } >&5
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
- $as_test_x conftest$ac_exeext
+ test -x conftest$ac_exeext
}; then :
ac_retval=0
else
@@ -2225,7 +2243,7 @@ $as_echo "$ac_try_echo"; } >&5
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
- $as_test_x conftest$ac_exeext
+ test -x conftest$ac_exeext
}; then :
ac_retval=0
else
@@ -2603,7 +2621,8 @@ int
main ()
{
static int test_array [1 - 2 * !(($2) >= 0)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
;
return 0;
@@ -2619,7 +2638,8 @@ int
main ()
{
static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
;
return 0;
@@ -2645,7 +2665,8 @@ int
main ()
{
static int test_array [1 - 2 * !(($2) < 0)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
;
return 0;
@@ -2661,7 +2682,8 @@ int
main ()
{
static int test_array [1 - 2 * !(($2) >= $ac_mid)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
;
return 0;
@@ -2695,7 +2717,8 @@ int
main ()
{
static int test_array [1 - 2 * !(($2) <= $ac_mid)];
-test_array [0] = 0
+test_array [0] = 0;
+return test_array [0];
;
return 0;
@@ -2768,7 +2791,7 @@ This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by ULib $as_me 1.1.0, which was
-generated by GNU Autoconf 2.68. Invocation command line was
+generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3321,7 +3344,7 @@ case $as_dir/ in #((
# by default.
for ac_prog in ginstall scoinst install; do
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
if test $ac_prog = install &&
grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
# AIX install. It has an incompatible calling convention.
@@ -3490,7 +3513,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3530,7 +3553,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_STRIP="strip"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3581,7 +3604,7 @@ do
test -z "$as_dir" && as_dir=.
for ac_prog in mkdir gmkdir; do
for ac_exec_ext in '' $ac_executable_extensions; do
- { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+ as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
'mkdir (GNU coreutils) '* | \
'mkdir (coreutils) '* | \
@@ -3634,7 +3657,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_AWK="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -3973,7 +3996,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4013,7 +4036,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4066,7 +4089,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4107,7 +4130,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
@@ -4165,7 +4188,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4209,7 +4232,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -4655,8 +4678,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdarg.h>
#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -5024,7 +5046,7 @@ do
for ac_prog in grep ggrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+ as_fn_executable_p "$ac_path_GREP" || continue
# Check for GNU ac_path_GREP and select it if it is found.
# Check for GNU $ac_path_GREP
case `"$ac_path_GREP" --version 2>&1` in
@@ -5090,7 +5112,7 @@ do
for ac_prog in egrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+ as_fn_executable_p "$ac_path_EGREP" || continue
# Check for GNU ac_path_EGREP and select it if it is found.
# Check for GNU $ac_path_EGREP
case `"$ac_path_EGREP" --version 2>&1` in
@@ -5297,8 +5319,8 @@ else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-# define __EXTENSIONS__ 1
- $ac_includes_default
+# define __EXTENSIONS__ 1
+ $ac_includes_default
int
main ()
{
@@ -5521,7 +5543,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -5565,7 +5587,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CXX="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -6191,7 +6213,7 @@ do
for ac_prog in sed gsed; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+ as_fn_executable_p "$ac_path_SED" || continue
# Check for GNU ac_path_SED and select it if it is found.
# Check for GNU $ac_path_SED
case `"$ac_path_SED" --version 2>&1` in
@@ -6270,7 +6292,7 @@ do
for ac_prog in fgrep; do
for ac_exec_ext in '' $ac_executable_extensions; do
ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
- { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+ as_fn_executable_p "$ac_path_FGREP" || continue
# Check for GNU ac_path_FGREP and select it if it is found.
# Check for GNU $ac_path_FGREP
case `"$ac_path_FGREP" --version 2>&1` in
@@ -6526,7 +6548,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -6570,7 +6592,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -6989,7 +7011,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7029,7 +7051,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OBJDUMP="objdump"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7332,7 +7354,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7372,7 +7394,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_DLLTOOL="dlltool"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7473,7 +7495,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7517,7 +7539,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_AR="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7642,7 +7664,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7682,7 +7704,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_STRIP="strip"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7741,7 +7763,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -7781,7 +7803,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_RANLIB="ranlib"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -8416,7 +8438,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -8456,7 +8478,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -8536,7 +8558,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -8576,7 +8598,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -8628,7 +8650,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -8668,7 +8690,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_NMEDIT="nmedit"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -8720,7 +8742,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -8760,7 +8782,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_LIPO="lipo"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -8812,7 +8834,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -8852,7 +8874,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OTOOL="otool"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -8904,7 +8926,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -8944,7 +8966,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OTOOL64="otool64"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -9241,7 +9263,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_AS="${ac_tool_prefix}as"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -9281,7 +9303,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_AS="as"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -9333,7 +9355,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -9373,7 +9395,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_DLLTOOL="dlltool"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -9425,7 +9447,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -9465,7 +9487,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OBJDUMP="objdump"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -16682,7 +16704,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -16722,7 +16744,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="gcc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -16775,7 +16797,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -16816,7 +16838,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
ac_prog_rejected=yes
continue
@@ -16874,7 +16896,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -16918,7 +16940,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -17114,8 +17136,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <stdarg.h>
#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
+struct stat;
/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
struct buf { int x; };
FILE * (*rcsopen) (struct buf *, struct stat *, int);
@@ -17545,7 +17566,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -17585,7 +17606,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_RANLIB="ranlib"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -19571,6 +19592,12 @@ $as_echo_n "checking for the kernel version... " >&6; }
kernel=`uname -r`
case "${kernel}" in
+ 4.*)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: 4 family (${kernel})" >&5
+$as_echo "4 family (${kernel})" >&6; }
+# AC_DEFINE([KERNEL_4], 1, [Define to 1 if you're using Linux 4.x])
+ ;;
+
3.*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: 3 family (${kernel})" >&5
$as_echo "3 family (${kernel})" >&6; }
@@ -19592,7 +19619,7 @@ $as_echo "2.4 family (${kernel})" >&6; }
*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported (${kernel})" >&5
$as_echo "unsupported (${kernel})" >&6; }
- as_fn_error $? "ULib works on kernels 2.4, 2.6" "$LINENO" 5
+ as_fn_error $? "ULib works on kernels 2.4,2.6,3" "$LINENO" 5
;;
esac
@@ -19666,7 +19693,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_WINDRES="${ac_tool_prefix}windres"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -19706,7 +19733,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_WINDRES="windres"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -19760,7 +19787,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ms_librarian="yes"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -20129,7 +20156,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -20173,7 +20200,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CXX="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -21171,7 +21198,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_YACC="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -21214,7 +21241,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_LEX="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -21246,7 +21273,8 @@ a { ECHO; }
b { REJECT; }
c { yymore (); }
d { yyless (1); }
-e { yyless (input () != 0); }
+e { /* IRIX 6.5 flex 2.5.4 underquotes its yyless argument. */
+ yyless ((input () != 0)); }
f { unput (yytext[0]); }
. { BEGIN INITIAL; }
%%
@@ -21373,7 +21401,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_XYACC="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -21420,7 +21448,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_XLEX="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -25058,7 +25086,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_PTHREAD_CC="cc_r"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -26114,11 +26142,11 @@ else
int
main ()
{
-/* FIXME: Include the comments suggested by Paul. */
+
#ifndef __cplusplus
- /* Ultrix mips cc rejects this. */
+ /* Ultrix mips cc rejects this sort of thing. */
typedef int charset[2];
- const charset cs;
+ const charset cs = { 0, 0 };
/* SunOS 4.1.1 cc rejects this. */
char const *const *pcpcc;
char **ppc;
@@ -26135,8 +26163,9 @@ main ()
++pcpcc;
ppc = (char**) pcpcc;
pcpcc = (char const *const *) ppc;
- { /* SCO 3.2v4 cc rejects this. */
- char *t;
+ { /* SCO 3.2v4 cc rejects this sort of thing. */
+ char tx;
+ char *t = &tx;
char const *s = 0 ? (char *) 0 : (char const *) 0;
*t++ = 0;
@@ -26152,10 +26181,10 @@ main ()
iptr p = 0;
++p;
}
- { /* AIX XL C 1.02.0.0 rejects this saying
+ { /* AIX XL C 1.02.0.0 rejects this sort of thing, saying
"k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; };
- struct s *b; b->j = 5;
+ struct s { int j; const int *ap[3]; } bx;
+ struct s *b = &bx; b->j = 5;
}
{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
const int foo = 10;
@@ -27671,7 +27700,7 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ulib_cv_flags" >&5
$as_echo "$ulib_cv_flags" >&6; }
- # NB: "-g -O2" e' gia' inserito in configure...
+ # NB: "-g -O2" it is already present in configure script...
CPPFLAGS="${CPPFLAGS} -pipe -D_GNU_SOURCE"
CFLAGS="${CFLAGS} $ulib_cv_CC_flags"
@@ -27730,7 +27759,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_cpp="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -27776,7 +27805,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_mcpp="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -27825,7 +27854,7 @@ do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
- if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_DOXYGEN="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
@@ -28968,16 +28997,16 @@ if (echo >conf$$.file) 2>/dev/null; then
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
- # In both cases, we have to default to `cp -p'.
+ # In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
else
- as_ln_s='cp -p'
+ as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
@@ -29037,28 +29066,16 @@ else
as_mkdir_p=false
fi
-if test -x / >/dev/null 2>&1; then
- as_test_x='test -x'
-else
- if ls -dL / >/dev/null 2>&1; then
- as_ls_L_option=L
- else
- as_ls_L_option=
- fi
- as_test_x='
- eval sh -c '\''
- if test -d "$1"; then
- test -d "$1/.";
- else
- case $1 in #(
- -*)set "./$1";;
- esac;
- case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
- ???[sx]*):;;*)false;;esac;fi
- '\'' sh
- '
-fi
-as_executable_p=$as_test_x
+
+# as_fn_executable_p FILE
+# -----------------------
+# Test if FILE is an executable regular file.
+as_fn_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+} # as_fn_executable_p
+as_test_x='test -x'
+as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
@@ -29080,7 +29097,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# values after options handling.
ac_log="
This file was extended by ULib $as_me 1.1.0, which was
-generated by GNU Autoconf 2.68. Invocation command line was
+generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
CONFIG_HEADERS = $CONFIG_HEADERS
@@ -29146,10 +29163,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
ULib config.status 1.1.0
-configured by $0, generated by GNU Autoconf 2.68,
+configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2012 Free Software Foundation, Inc.
This config.status script is free software; the Free Software Foundation
gives unlimited permission to copy, distribute and modify it."
@@ -29240,7 +29257,7 @@ fi
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
if \$ac_cs_recheck; then
- set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+ set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
shift
\$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
CONFIG_SHELL='$SHELL'
View
9 configure.in
@@ -219,6 +219,11 @@ case "$target_os" in
kernel=`uname -r`
case "${kernel}" in
+ 4.*)
+ AC_MSG_RESULT([4 family (${kernel})])
+# AC_DEFINE([KERNEL_4], 1, [Define to 1 if you're using Linux 4.x])
+ ;;
+
3.*)
AC_MSG_RESULT([3 family (${kernel})])
# AC_DEFINE([KERNEL_3], 1, [Define to 1 if you're using Linux 3.x])
@@ -236,7 +241,7 @@ case "$target_os" in
*)
AC_MSG_RESULT([unsupported (${kernel})])
- AC_MSG_ERROR([ULib works on kernels 2.4, 2.6])
+ AC_MSG_ERROR([ULib works on kernels 2.4,2.6,3])
;;
esac
@@ -1041,7 +1046,7 @@ if test "${ac_cv_c_compiler_gnu}" = "yes"; then
AC_MSG_CHECKING([which gcc flags were supported])
])
- # NB: "-g -O2" e' gia' inserito in configure...
+ # NB: "-g -O2" it is already present in configure script...
CPPFLAGS="${CPPFLAGS} -pipe -D_GNU_SOURCE"
CFLAGS="${CFLAGS} $ulib_cv_CC_flags"
View
2  examples/IR/update.cpp
@@ -60,7 +60,7 @@ class Application : public IR {
dir = filename.substr(0U, pos);
filter = filename.substr(pos + 1);
- UDirWalk dirwalk(&dir, U_STRING_TO_PARAM(filter));
+ UDirWalk dirwalk(dir.c_str(), U_STRING_TO_PARAM(filter));
(void) dirwalk.walk(vec);
}
View
2  examples/WiAuth/wi_auth.cpp
@@ -3322,7 +3322,7 @@
if (bstart) nodog_rec->setDown(true);
(void) nodog_rec->setDown(false);
- U_LOGGER("%.*s:%.*s %s", U_STRING_TO_TRACE(*address), U_STRING_TO_TRACE(*hostname), bstart ? "started" : "*** AP CRASHED ***");
+ U_LOGGER("%.*s:%.*s %s", U_STRING_TO_TRACE(*address), U_STRING_TO_TRACE(*hostname), bstart ? "started" : "*** NODOG CRASHED ***");
callForAllUsers(quitUserConnected);
}
View
2  examples/WiAuth/wi_auth.usp
@@ -3319,7 +3319,7 @@ static void GET_start_ap()
if (bstart) nodog_rec->setDown(true);
(void) nodog_rec->setDown(false);
- U_LOGGER("%.*s:%.*s %s", U_STRING_TO_TRACE(*address), U_STRING_TO_TRACE(*hostname), bstart ? "started" : "*** AP CRASHED ***");
+ U_LOGGER("%.*s:%.*s %s", U_STRING_TO_TRACE(*address), U_STRING_TO_TRACE(*hostname), bstart ? "started" : "*** NODOG CRASHED ***");
callForAllUsers(quitUserConnected);
}
View
6 include/ulib/command.h
@@ -113,6 +113,7 @@ class U_EXPORT UCommand {
U_TRACE(0, "UCommand::addArgument(%S)", argument)
U_INTERNAL_ASSERT_POINTER(argv_exec)
+ U_INTERNAL_ASSERT(u_isText((const unsigned char*)argument, u__strlen(argument)))
argv_exec[++ncmd] = (char*) argument;
argv_exec[ncmd+1] = 0;
@@ -128,6 +129,7 @@ class U_EXPORT UCommand {
U_INTERNAL_ASSERT_RANGE(2,n,ncmd)
U_INTERNAL_ASSERT_POINTER(argv_exec)
+ U_INTERNAL_ASSERT(u_isText((const unsigned char*)argument, u__strlen(argument)))
argv_exec[n] = (char*) argument;
}
@@ -138,6 +140,7 @@ class U_EXPORT UCommand {
U_INTERNAL_ASSERT_POINTER(argv_exec)
U_INTERNAL_ASSERT_EQUALS(argv_exec[ncmd+1],0)
+ U_INTERNAL_ASSERT(u_isText((const unsigned char*)argument, u__strlen(argument)))
argv_exec[ncmd] = (char*) argument;
}
@@ -152,6 +155,7 @@ class U_EXPORT UCommand {
U_TRACE(0, "UCommand::setFileArgument(%S)", pathfile)
U_INTERNAL_ASSERT_POINTER(argv_exec)
+ U_INTERNAL_ASSERT(u_isText((const unsigned char*)pathfile, u__strlen(pathfile)))
U_INTERNAL_DUMP("ncmd = %d", ncmd)
@@ -210,6 +214,8 @@ class U_EXPORT UCommand {
char* result = (argv_exec ? argv_exec[(isShellScript() ? 2 : 0)] : 0);
+ U_INTERNAL_ASSERT(u_isText((const unsigned char*)result, u__strlen(result)))
+
U_RETURN(result);
}
View
31 include/ulib/file.h
@@ -617,7 +617,7 @@ class U_EXPORT UFile : public stat {
(void) U_SYSCALL(munmap, "%p,%u", _map, length);
}
- static void msync(char* ptr, char* page, int flags = MS_SYNC); // flushes changes made to memory mapped file back to disk
+ static void msync(char* ptr, char* page, int flags = MS_ASYNC | MS_INVALIDATE); // flushes changes made to memory mapped file back to disk
// mremap() expands (or shrinks) an existing memory mapping, potentially moving it at the same time
// (controlled by the flags argument and the available virtual address space)
@@ -725,9 +725,16 @@ class U_EXPORT UFile : public stat {
static int getSysParam(const char* name);
static int setSysParam(const char* name, int value, bool force = false);
- bool write( const UString& data, bool append = false, bool bmkdirs = false);
- static bool writeTo(const UString& path, const UString& data, bool append = false, bool bmkdirs = false);
- static bool writeToTmpl(const char* tmpl, const UString& data, bool append = false, bool bmkdirs = false);
+ bool write(const char* data, uint32_t sz, bool append, bool bmkdirs);
+ bool write(const UString& data, bool append = false, bool bmkdirs = false) { return write(U_STRING_TO_PARAM(data), append, bmkdirs); }
+
+ static bool writeTo(const UString& path, const char* data, uint32_t sz, bool append, bool bmkdirs);
+ static bool writeTo(const UString& path, const UString& data, bool append = false, bool bmkdirs = false)
+ { return writeTo(path, U_STRING_TO_PARAM(data), append, bmkdirs); }
+
+ static bool writeToTmpl(const char* tmpl, const char* data, uint32_t sz, bool append, bool bmkdirs);
+ static bool writeToTmpl(const char* tmpl, const UString& data, bool append = false, bool bmkdirs = false)
+ { return writeToTmpl(tmpl, U_STRING_TO_PARAM(data), append, bmkdirs); }
// symlink creates a symbolic link named newpath which contains the string oldpath
@@ -769,9 +776,7 @@ class U_EXPORT UFile : public stat {
static UString getRealPath(const char* path);
- // TEMP FILES
-
- bool mkTemp(const char* _tmpl = "lockXXXXXX"); // temporary file for locking...
+ // TEMP OP
// ----------------------------------------------------------------------------------------------------------------------
// create a unique temporary file
@@ -780,16 +785,16 @@ class U_EXPORT UFile : public stat {
// The last six characters of template must be XXXXXX and these are replaced with a string that makes the filename unique
// ----------------------------------------------------------------------------------------------------------------------
- static int mkstemp(char* _template);
+ bool mkTemp(char* _template);
- // ----------------------------------------------------------------------------------------------------------------------
+ // --------------------------------------------------------------------------------------------------------------
// mkdtemp - create a unique temporary directory
- // ------------------------------------------------------------------------------------------------------------
+ // --------------------------------------------------------------------------------------------------------------
// The mkdtemp() function generates a uniquely-named temporary directory from template. The last six characters
// of template must be XXXXXX and these are replaced with a string that makes the directory name unique.
- // The directory is then created with permissions 0700. Since it will be modified, template must not be a string
- // constant, but should be declared as a character array.
- // ------------------------------------------------------------------------------------------------------------
+ // The directory is then created with permissions 0700.
+ // Since it will be modified, template must not be a string constant, but should be declared as a character array
+ // --------------------------------------------------------------------------------------------------------------
static bool mkdtemp(UString& _template);
View
45 include/ulib/log.h
@@ -17,10 +17,14 @@
#include <ulib/file.h>
#include <ulib/utility/lock.h>
+#define LOG_ptr ULog::ptr_log_data->file_ptr
+#define LOG_page ULog::ptr_log_data->file_page
+#define LOG_gzip_len ULog::ptr_log_data->gzip_len
+#define LOG_gzip_ptr ((char*)&(ULog::ptr_log_data->gzip_len)+sizeof(uint32_t))
+
class ULog;
class UTimeThread;
-
-typedef void (*vPFpf)(const ULog*);
+class UServer_Base;
class U_EXPORT ULog : public UFile {
public:
@@ -29,17 +33,18 @@ class U_EXPORT ULog : public UFile {
char* file_ptr;
char* file_page;
sem_t lock_shared;
+ uint32_t gzip_len;
+ // --------------> maybe unnamed array of char for gzip compression...
} log_data;
static ULog* pthis;
static ULock* lock;
static const char* fmt;
static char* LOG_FILE_SZ;
- static uint32_t map_size;
static const char* prefix;
+ static uint32_t LOG_gzip_sz;
static const char* dir_log_gz;
static log_data* ptr_log_data;
- static vPF log_rotate_function;
static bool bsyslog, log_data_must_be_unmapped;
// COSTRUTTORI
@@ -48,7 +53,7 @@ class U_EXPORT ULog : public UFile {
{
U_TRACE_REGISTER_OBJECT(0, ULog, "%.*S,%u,%S", U_STRING_TO_TRACE(path), _size, _prefix)
- U_INTERNAL_ASSERT_EQUALS(ptr_log_data,0)
+ U_INTERNAL_ASSERT_EQUALS(ptr_log_data, 0)
prefix = _prefix;
@@ -104,7 +109,8 @@ class U_EXPORT ULog : public UFile {
static void msync(); // flushes changes made to memory mapped log file back to disk
static void startup();
- static void setShared(log_data* ptr);
+ static void setAsChild();
+ static void setShared(log_data* ptr, uint32_t size);
// write with prefix
@@ -129,23 +135,33 @@ class U_EXPORT ULog : public UFile {
bool open(uint32_t size, mode_t mode = 0664);
#ifdef USE_LIBZ
- static void* pthread;
static uint32_t path_compress;
- static UString* data_to_write;
static UString* buffer_path_compress;
// if overwrite log file compress it as gzip...
- static void logRotate();
- static void logRotateWrite();
+ static RETSIGTYPE logRotate(int signo); // manage also signal SIGUSR1...
+ static void logRotateWrite(uint32_t sz);
+#endif
- static RETSIGTYPE handlerSIGUSR1(int signo) // manage signal SIGUSR1
+ static bool checkForLogRotateDataToWrite()
{
- U_TRACE(0, "ULog::handlerSIGUSR1(%d)", signo)
+ U_TRACE(0, "ULog::checkForLogRotateDataToWrite()")
+
+# ifdef USE_LIBZ
+ if (pthis &&
+ LOG_gzip_len)
+ {
+ logRotateWrite(0);
- logRotate();
+ U_INTERNAL_ASSERT_EQUALS(LOG_gzip_len, 0)
+
+ U_RETURN(true);
+ }
+# endif
+
+ U_RETURN(false);
}
-#endif
private:
static int decode(const char* name, uint32_t len, bool bfacility) __pure U_NO_EXPORT;
@@ -154,6 +170,7 @@ class U_EXPORT ULog : public UFile {
ULog& operator=(const ULog&) { return *this; }
friend class UTimeThread;
+ friend class UServer_Base;
};
#endif
View
4 include/ulib/net/client/imap.h
@@ -16,6 +16,10 @@
#include <ulib/container/vector.h>
+#ifdef SocketInit
+#undef SocketInit
+#endif
+
#ifdef USE_LIBSSL
# include <ulib/ssl/net/sslsocket.h>
# define Socket USSLSocket
View
4 include/ulib/net/client/pop3.h
@@ -16,6 +16,10 @@
#include <ulib/internal/common.h>
+#ifdef SocketInit
+#undef SocketInit
+#endif
+
#ifdef USE_LIBSSL
# include <ulib/ssl/net/sslsocket.h>
# define Socket USSLSocket
View
6 include/ulib/net/client/smtp.h
@@ -16,10 +16,14 @@
#include <ulib/internal/common.h>
+#ifdef SocketInit
+#undef SocketInit
+#endif
+
#ifdef USE_LIBSSL
# include <ulib/ssl/net/sslsocket.h>
# define Socket USSLSocket
-# define SocketInit(b) USSLSocket(b,0,false)
+# define SocketInit(b) USSLSocket(b,USSLSocket::getContext((SSL_METHOD*)SSLv23_client_method(),false,0),false)
#else
# include <ulib/net/tcpsocket.h>
# define Socket UTCPSocket
View
6 include/ulib/net/server/plugin/mod_nocat.h
@@ -22,6 +22,7 @@
#include <ulib/container/hash_map.h>
#include <ulib/net/server/server_plugin.h>
+class UDirWalk;
class UIptAccount;
class UNoCatPlugIn;
@@ -57,10 +58,10 @@ class UModNoCatPeer : public UEventTime, UIPAddress {
protected:
UCommand fw;
- unsigned char flag[8];
UString ip, mac, token, user, ifname, label, gateway;
- uint64_t traffic_done, traffic_available, traffic_remain;
time_t connected, expire, logout, ctime, time_no_traffic, time_remain;
+ uint64_t traffic_done, traffic_available, traffic_remain;
+ unsigned char flag[8];
uint32_t ctraffic;
bool checkPeerInfo(bool btraffic);
@@ -209,6 +210,7 @@ class U_EXPORT UNoCatPlugIn : public UServerPlugIn, UEventTime {
static fd_set addrmask;
static fd_set* paddrmask;
static UIptAccount* ipt;
+ static UDirWalk* dirwalk;
static bool flag_check_system;
static UString* login_timeout;
static UString* status_content;
View
9 include/ulib/net/server/server.h
@@ -270,8 +270,6 @@ class U_EXPORT UServer_Base : public UEventFd {
sig_atomic_t cnt_user2;
sig_atomic_t cnt_connection;
// ---------------------------------
- ULog::log_data log_data_shared;
- // ---------------------------------
struct timeval _timeval;
long last_sec[3];
char data_1[17]; // 18/06/12 18:45:56
@@ -280,7 +278,10 @@ class U_EXPORT UServer_Base : public UEventFd {
char null2[1]; // 123456789012345678901234567890
char data_3[29]; // Wed, 20 Jun 2012 11:43:17 GMT
char null3[1]; // 123456789012345678901234567890
- // -------------------------------
+ // ------------------------------------------------------------------------------
+ ULog::log_data log_data_shared;
+ // -> maybe unnamed array of char for gzip compression (log rotate)...
+ // --------------------------------------------------------------------------------
} shared_data;
#define U_LOCK_USER1 &(UServer_Base::ptr_shared_data->lock_user1)
@@ -288,11 +289,11 @@ class U_EXPORT UServer_Base : public UEventFd {
#define U_LOCK_RDB_SERVER &(UServer_Base::ptr_shared_data->lock_rdb_server)
#define U_LOCK_SSL_SESSION &(UServer_Base::ptr_shared_data->lock_ssl_session)
#define U_LOCK_HTTP_SESSION &(UServer_Base::ptr_shared_data->lock_http_session)
-#define U_LOG_DATA_SHARED &(UServer_Base::ptr_shared_data->log_data_shared)
#define U_CNT_USER1 UServer_Base::ptr_shared_data->cnt_user1
#define U_CNT_USER2 UServer_Base::ptr_shared_data->cnt_user2
#define U_TOT_CONNECTION UServer_Base::ptr_shared_data->cnt_connection
#define U_NOW &(UServer_Base::ptr_shared_data->_timeval)
+#define U_LOG_DATA_SHARED &(UServer_Base::ptr_shared_data->log_data_shared)
static pid_t pid;
static int preforked_num_kids; // keeping a pool of children and that they accept connections themselves
View
16 include/ulib/process.h
@@ -63,16 +63,24 @@ class U_EXPORT UProcess {
bool fork();
- pid_t pid() const { return _pid; }
-
- bool child() const { return (_pid == 0); }
+ bool child() const { return (_pid == 0); }
bool parent() const { return (_pid > 0); }
+ pid_t pid() const { return _pid; }
+ pid_t ppid() const
+ {
+ U_TRACE(0, "UProcess::ppid()")
+
+ pid_t _ppid = U_SYSCALL_NO_PARAM(getppid);
+
+ U_RETURN(_ppid);
+ }
+
// WAIT
void wait()
{
- U_TRACE(1, "UProcess::wait()")
+ U_TRACE(0, "UProcess::wait()")
U_CHECK_MEMORY
View
1  include/ulib/ssl/net/sslsocket.h
@@ -258,6 +258,7 @@ class U_EXPORT USSLSocket : public UTCPSocket {
bool active;
static int session_cache_index;
+ static const char* protocol_version;
static void info_callback(const SSL* ssl, int where, int ret);
static const char* status(SSL* ssl, int ret, bool _flag, char* buffer, uint32_t buffer_size);
View
6 include/ulib/timeval.h
@@ -169,7 +169,7 @@ class U_EXPORT UTimeVal : public timeval {
U_CHECK_MEMORY
- long result = tv_sec + (tv_usec >= 500000L ? 1 : 0);
+ long result = tv_sec + (tv_usec >= 500000L ? 1L : 0L);
U_RETURN(result);
}
@@ -298,7 +298,7 @@ class U_EXPORT UTimeVal : public timeval {
U_INTERNAL_ASSERT_RANGE(0L, tv_usec, U_SECOND)
t->tv_sec = tv_sec;
- t->tv_nsec = tv_usec * 1000;
+ t->tv_nsec = tv_usec * 1000L;
}
bool operator>(struct timespec* t) const
@@ -310,7 +310,7 @@ class U_EXPORT UTimeVal : public timeval {
U_INTERNAL_ASSERT_RANGE(0L, tv_usec, U_SECOND)
bool result = (tv_sec > t->tv_sec ||
- (tv_sec == t->tv_sec && ((tv_usec * 1000) > t->tv_nsec)));
+ (tv_sec == t->tv_sec && ((tv_usec * 1000L) > t->tv_nsec)));
U_RETURN(result);
}
View
6 include/ulib/utility/dir_walk.h
@@ -50,7 +50,7 @@ class U_EXPORT UDirWalk {
// Costruttori
- UDirWalk(const UString* dir = 0, const char* filter = 0, uint32_t filter_len = 0);
+ UDirWalk(const char* dir = 0, const char* filter = 0, uint32_t filter_len = 0);
virtual ~UDirWalk()
{
U_TRACE_UNREGISTER_OBJECT(0, UDirWalk)
@@ -106,6 +106,8 @@ class U_EXPORT UDirWalk {
path.replace(pthis->pathname+2, pthis->pathlen-2);
}
+ static bool setDirectory(const char* dir, const char* filter = 0, uint32_t filter_len = 0);
+
// DEBUG
#ifdef DEBUG
@@ -136,6 +138,8 @@ class U_EXPORT UDirWalk {
{
U_TRACE(0, "UDirWalk::foundFile()")
+ U_INTERNAL_ASSERT_EQUALS(pthis, this)
+
if (call_internal) call_internal();
}
View
71 include/ulib/utility/semaphore.h
@@ -16,31 +16,38 @@
#include <ulib/internal/common.h>
+#ifndef ENABLE_THREAD
+# define U_LOCKFILE
+# include <ulib/file.h>
+typedef int sem_t;
+#endif
+
#ifdef __MINGW32__
+typedef DWORD timeout_t;
typedef HANDLE sem_t;
# define MAX_SEM_VALUE 1000000
-#elif defined(HAVE_SEMAPHORE_H)
-# include <semaphore.h>
-// -------------------------------------------------------------
-// check for broken implementation on Linux (debian)...
-// -------------------------------------------------------------
-# if defined(LINUX) || defined(__LINUX__) || defined(__linux__)
-# include <linux/version.h>
-# ifndef KERNEL_VERSION
-# define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
-# endif
-# ifndef LINUX_VERSION_CODE
-# error "You need to use at least 2.0 Linux kernel."
-# endif
-# if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,7)
-# define U_MAYBE_BROKEN_SEM_IMPL
-# endif
-# endif
-// -------------------------------------------------------------
#else
+typedef time_t timeout_t;
+# if !defined(U_LOCKFILE) && defined(HAVE_SEMAPHORE_H)
+# include <semaphore.h>
+// -------------------------------------------------------------
+// check for broken implementation on Linux (debian)...
+// -------------------------------------------------------------
+# if defined(LINUX) || defined(__LINUX__) || defined(__linux__)
+# include <linux/version.h>
+# ifndef KERNEL_VERSION
+# define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
+# endif
+# ifndef LINUX_VERSION_CODE
+# error "You need to use at least 2.0 Linux kernel."
+# endif
+# if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,7)
+# define U_MAYBE_BROKEN_SEM_IMPL
+# endif
+# endif
+// -------------------------------------------------------------
/*
-typedef int sem_t;
-
+# else
extern "C" {
int sem_wait(sem_t*__sem);
int sem_post(sem_t* __sem);
@@ -49,9 +56,10 @@ int sem_getvalue(sem_t* sem, int* sval);
int sem_init(sem_t* __sem, int __pshared, unsigned int __value):
}
*/
+# endif
#endif
-#if !defined(HAVE_SEMAPHORE_H) || defined(U_MAYBE_BROKEN_SEM_IMPL) // _LIBC // uClib
+#if !defined(U_LOCKFILE) && (!defined(HAVE_SEMAPHORE_H) || defined(U_MAYBE_BROKEN_SEM_IMPL)) // _LIBC // uClib
# ifdef _POSIX_THREAD_PROCESS_SHARED
# ifdef HAVE_PTHREAD_H
# include <pthread.h>
@@ -64,22 +72,9 @@ int pthread_mutex_destroy(pthread_mutex_t* mutex);
int pthread_mutexattr_init(pthread_mutexattr_t* mutex_attr);
int pthread_mutex_init(pthread_mutex_t* mutex, const pthread_mutexattr_t* mutex_attr); }
# endif
-# else
-# define U_LOCKFILE
-# undef U_MAYBE_BROKEN_SEM_IMPL
# endif
#endif
-#ifdef U_LOCKFILE
-# include <ulib/file.h>
-#endif
-
-#ifdef __MINGW32__
-typedef DWORD timeout_t;
-#else
-typedef time_t timeout_t;
-#endif
-
class UTimeVal;
class UServer_Base;
@@ -156,13 +151,13 @@ class U_EXPORT USemaphore {
protected:
USemaphore* next;
-#ifdef __MINGW32__
- HANDLE sem;
-#elif defined(U_LOCKFILE)
+#ifdef U_LOCKFILE
UFile tmp;
+#elif defined(__MINGW32__)
+ HANDLE sem;
#else
sem_t* sem;
-# if defined(U_MAYBE_BROKEN_SEM_IMPL)
+# ifdef U_MAYBE_BROKEN_SEM_IMPL
pthread_mutex_t mutex;
pthread_mutexattr_t mutex_attr;
# endif
View
4 src/ulib/cache.cpp
@@ -95,8 +95,8 @@ bool UCache::open(const UString& path, const UString& dir_template, const UStrin
{
UDirWalk dirwalk;
bool exist = true;
- uint32_t i, n, size = 0, hsize;
UVector<UString> vec1(256), vec2;
+ uint32_t i, n, size = 0, hsize = 0;
if (( _x.size() == 0 ||
(_x.fstat(), _x.st_mtime < _y.st_mtime)) &&
@@ -365,7 +365,7 @@ void UCache::loadContentOf(const UString& dir, const char* filter, uint32_t filt
UString item, content;
UVector<UString> vec(128);
- UDirWalk dirwalk(&dir, filter, filter_len);
+ UDirWalk dirwalk(dir.c_str(), filter, filter_len);
for (uint32_t i = 0, n = dirwalk.walk(vec); i < n; ++i)
{
View
4 src/ulib/db/rdb.cpp
@@ -151,8 +151,6 @@ U_NO_EXPORT inline bool URDB::resizeJournal(uint32_t oversize)
U_INTERNAL_DUMP("oversize = %u", oversize)
-// msync();
-
uint32_t _offset = (char*)pnode - journal.map;
U_INTERNAL_DUMP("pnode = %p node = %u offset = %u", pnode, node, _offset)
@@ -464,7 +462,7 @@ void URDB::msync()
U_INTERNAL_DUMP("RDB_off = %u RDB_sync = %u", RDB_off, RDB_sync)
- UFile::msync(journal.map+RDB_off, journal.map+RDB_sync);
+ UFile::msync(journal.map + RDB_off, journal.map + RDB_sync);
RDB_sync = RDB_off;
View
139 src/ulib/file.cpp
@@ -89,7 +89,7 @@ void UFile::setPathRelativ(const UString* environment)
path_relativ_len = pathname.size();
path_relativ = u_getPathRelativ(pathname.c_str(), &path_relativ_len);
- U_INTERNAL_ASSERT_MAJOR(path_relativ_len,0)
+ U_INTERNAL_ASSERT_MAJOR(path_relativ_len, 0)
// we don't need this... (I think)
@@ -389,7 +389,7 @@ char* UFile::mmap(uint32_t* plength, int _fd, int prot, int flags, uint32_t offs
#ifndef __MINGW32__
# ifndef HAVE_ARCH64
- U_INTERNAL_ASSERT_RANGE(1U, *plength, 3U * 1024U * 1024U *1024U) // limit of linux system on 32bit
+ U_INTERNAL_ASSERT_RANGE(1U, *plength, 3U * 1024U * 1024U * 1024U) // limit of linux system on 32bit
# endif
if (_fd != -1)
#endif
@@ -403,19 +403,25 @@ char* UFile::mmap(uint32_t* plength, int _fd, int prot, int flags, uint32_t offs