diff options
author | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-01-13 00:26:18 +0100 |
---|---|---|
committer | Nikos Mavrogiannopoulos <nmav@gnutls.org> | 2012-01-13 00:26:18 +0100 |
commit | e22616adaae8205454cbd5df3f74e144976b2a6a (patch) | |
tree | d0606d386ef7af043c8ca9413cd8aace92b21bb1 | |
parent | 3bd122633647cd7f9e8e73c96c4779dd1b7a1549 (diff) | |
download | gnutls-e22616adaae8205454cbd5df3f74e144976b2a6a.tar.gz |
usleep() is no longer used.
-rw-r--r-- | gl/Makefile.am | 12 | ||||
-rw-r--r-- | gl/argp-parse.c | 5 | ||||
-rw-r--r-- | gl/inet_ntop.c | 12 | ||||
-rw-r--r-- | gl/m4/gnulib-cache.m4 | 5 | ||||
-rw-r--r-- | gl/m4/gnulib-comp.m4 | 10 | ||||
-rw-r--r-- | gl/m4/ld-version-script.m4 | 15 | ||||
-rw-r--r-- | gl/m4/printf.m4 | 4 | ||||
-rw-r--r-- | gl/m4/stdlib_h.m4 | 3 | ||||
-rw-r--r-- | gl/m4/usleep.m4 | 35 | ||||
-rw-r--r-- | gl/select.c | 4 | ||||
-rw-r--r-- | gl/stdlib.in.h | 66 | ||||
-rw-r--r-- | gl/tests/Makefile.am | 8 | ||||
-rw-r--r-- | gl/tests/ignore-value.h | 5 | ||||
-rw-r--r-- | gl/tests/pipe.c | 2 | ||||
-rwxr-xr-x | gl/tests/test-init.sh | 2 | ||||
-rw-r--r-- | gl/tests/test-usleep.c | 40 | ||||
-rw-r--r-- | gl/usleep.c | 58 | ||||
-rw-r--r-- | maint.mk | 2 | ||||
-rw-r--r-- | src/udp-serv.c | 1 |
19 files changed, 96 insertions, 193 deletions
diff --git a/gl/Makefile.am b/gl/Makefile.am index ed4c9fd5f3..5b60086542 100644 --- a/gl/Makefile.am +++ b/gl/Makefile.am @@ -21,7 +21,7 @@ # the same distribution terms as the rest of that program. # # Generated by gnulib-tool. -# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lseek-tests --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alloca alphasort argp bind byteswap c-ctype close connect error extensions freeaddrinfo func getaddrinfo getnameinfo getpass getsubopt gettext gettime havelib inet_ntop inet_pton lib-msvc-compat lib-symbol-versions listen maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in pmccabe2html progname read-file recv recvfrom scandir select send sendto setsockopt shutdown snprintf socket sockets socklen stdint strcase strverscmp sys_socket sys_stat time_r timespec u64 unistd usleep valgrind-tests vasprintf version-etc version-etc-fsf vfprintf-posix vprintf-posix vsnprintf warnings +# Reproduce by: gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lseek-tests --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alloca alphasort argp bind byteswap c-ctype close connect error extensions func getaddrinfo getpass getsubopt gettext gettime havelib inet_ntop inet_pton lib-msvc-compat lib-symbol-versions listen maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in pmccabe2html progname read-file recv recvfrom scandir select send sendto setsockopt shutdown snprintf socket sockets socklen stdint strcase strverscmp sys_socket sys_stat time_r timespec u64 unistd valgrind-tests vasprintf version-etc version-etc-fsf vfprintf-posix vprintf-posix vsnprintf warnings AUTOMAKE_OPTIONS = 1.5 gnits @@ -1658,6 +1658,7 @@ stdlib.h: stdlib.in.h $(top_builddir)/config.status $(CXXDEFS_H) \ -e 's|@''REPLACE_MKSTEMP''@|$(REPLACE_MKSTEMP)|g' \ -e 's|@''REPLACE_PTSNAME_R''@|$(REPLACE_PTSNAME_R)|g' \ -e 's|@''REPLACE_PUTENV''@|$(REPLACE_PUTENV)|g' \ + -e 's|@''REPLACE_RANDOM_R''@|$(REPLACE_RANDOM_R)|g' \ -e 's|@''REPLACE_REALLOC''@|$(REPLACE_REALLOC)|g' \ -e 's|@''REPLACE_REALPATH''@|$(REPLACE_REALPATH)|g' \ -e 's|@''REPLACE_SETENV''@|$(REPLACE_SETENV)|g' \ @@ -2357,15 +2358,6 @@ EXTRA_DIST += $(top_srcdir)/build-aux/useless-if-before-free ## end gnulib module useless-if-before-free -## begin gnulib module usleep - - -EXTRA_DIST += usleep.c - -EXTRA_libgnu_la_SOURCES += usleep.c - -## end gnulib module usleep - ## begin gnulib module vasnprintf diff --git a/gl/argp-parse.c b/gl/argp-parse.c index 39b8336f32..09558b4f8f 100644 --- a/gl/argp-parse.c +++ b/gl/argp-parse.c @@ -154,8 +154,9 @@ argp_version_parser (int key, char *arg, struct argp_state *state) else if (argp_program_version) fprintf (state->out_stream, "%s\n", argp_program_version); else - __argp_error (state, dgettext (state->root_argp->argp_domain, - "(PROGRAM ERROR) No version known!?")); + __argp_error (state, "%s", + dgettext (state->root_argp->argp_domain, + "(PROGRAM ERROR) No version known!?")); if (! (state->flags & ARGP_NO_EXIT)) exit (0); break; diff --git a/gl/inet_ntop.c b/gl/inet_ntop.c index eeffcbe46a..ab3c1ffd6e 100644 --- a/gl/inet_ntop.c +++ b/gl/inet_ntop.c @@ -38,6 +38,16 @@ /* Specification. */ #include <arpa/inet.h> +/* Use this to suppress gcc's "...may be used before initialized" warnings. + Beware: The Code argument must not contain commas. */ +#ifndef IF_LINT +# ifdef lint +# define IF_LINT(Code) Code +# else +# define IF_LINT(Code) /* empty */ +# endif +#endif + #if HAVE_DECL_INET_NTOP # undef inet_ntop @@ -167,6 +177,8 @@ inet_ntop6 (const unsigned char *src, char *dst, socklen_t size) words[i / 2] = (src[i] << 8) | src[i + 1]; best.base = -1; cur.base = -1; + IF_LINT(best.len = 0); + IF_LINT(cur.len = 0); for (i = 0; i < (NS_IN6ADDRSZ / NS_INT16SZ); i++) { if (words[i] == 0) diff --git a/gl/m4/gnulib-cache.m4 b/gl/m4/gnulib-cache.m4 index 74c1b399c2..2196a2be87 100644 --- a/gl/m4/gnulib-cache.m4 +++ b/gl/m4/gnulib-cache.m4 @@ -27,7 +27,7 @@ # Specification in the form of a command-line invocation: -# gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lseek-tests --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alloca alphasort argp bind byteswap c-ctype close connect error extensions freeaddrinfo func getaddrinfo getnameinfo getpass getsubopt gettext gettime havelib inet_ntop inet_pton lib-msvc-compat lib-symbol-versions listen maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in pmccabe2html progname read-file recv recvfrom scandir select send sendto setsockopt shutdown snprintf socket sockets socklen stdint strcase strverscmp sys_socket sys_stat time_r timespec u64 unistd usleep valgrind-tests vasprintf version-etc version-etc-fsf vfprintf-posix vprintf-posix vsnprintf warnings +# gnulib-tool --import --dir=. --local-dir=gl/override --lib=libgnu --source-base=gl --m4-base=gl/m4 --doc-base=doc --tests-base=gl/tests --aux-dir=build-aux --with-tests --avoid=alignof-tests --avoid=lseek-tests --no-conditional-dependencies --libtool --macro-prefix=gl --no-vc-files accept alloca alphasort argp bind byteswap c-ctype close connect error extensions func getaddrinfo getpass getsubopt gettext gettime havelib inet_ntop inet_pton lib-msvc-compat lib-symbol-versions listen maintainer-makefile manywarnings memmem-simple minmax netdb netinet_in pmccabe2html progname read-file recv recvfrom scandir select send sendto setsockopt shutdown snprintf socket sockets socklen stdint strcase strverscmp sys_socket sys_stat time_r timespec u64 unistd valgrind-tests vasprintf version-etc version-etc-fsf vfprintf-posix vprintf-posix vsnprintf warnings # Specification in the form of a few gnulib-tool.m4 macro invocations: gl_LOCAL_DIR([gl/override]) @@ -43,10 +43,8 @@ gl_MODULES([ connect error extensions - freeaddrinfo func getaddrinfo - getnameinfo getpass getsubopt gettext @@ -87,7 +85,6 @@ gl_MODULES([ timespec u64 unistd - usleep valgrind-tests vasprintf version-etc diff --git a/gl/m4/gnulib-comp.m4 b/gl/m4/gnulib-comp.m4 index fcf7b8da5b..c6f99cfa3a 100644 --- a/gl/m4/gnulib-comp.m4 +++ b/gl/m4/gnulib-comp.m4 @@ -324,8 +324,6 @@ AC_DEFUN([gl_EARLY], # Code from module unsetenv: # Code from module unsetenv-tests: # Code from module useless-if-before-free: - # Code from module usleep: - # Code from module usleep-tests: # Code from module valgrind-tests: # Code from module vasnprintf: # Code from module vasnprintf-tests: @@ -811,11 +809,6 @@ gl_TIME_MODULE_INDICATOR([time_r]) gl_TIMESPEC AC_REQUIRE([AC_C_INLINE]) gl_UNISTD_H -gl_FUNC_USLEEP -if test $HAVE_USLEEP = 0 || test $REPLACE_USLEEP = 1; then - AC_LIBOBJ([usleep]) -fi -gl_UNISTD_MODULE_INDICATOR([usleep]) gl_VALGRIND_TESTS gl_FUNC_VASNPRINTF gl_FUNC_VASPRINTF @@ -1278,7 +1271,6 @@ AC_DEFUN([gl_FILE_LIST], [ lib/timespec.h lib/u64.h lib/unistd.in.h - lib/usleep.c lib/vasnprintf.c lib/vasnprintf.h lib/vasprintf.c @@ -1455,7 +1447,6 @@ AC_DEFUN([gl_FILE_LIST], [ m4/uintmax_t.m4 m4/ungetc.m4 m4/unistd_h.m4 - m4/usleep.m4 m4/valgrind-tests.m4 m4/vasnprintf.m4 m4/vasprintf.m4 @@ -1623,7 +1614,6 @@ AC_DEFUN([gl_FILE_LIST], [ tests/test-u64.c tests/test-unistd.c tests/test-unsetenv.c - tests/test-usleep.c tests/test-vasnprintf.c tests/test-vasprintf.c tests/test-vc-list-files-cvs.sh diff --git a/gl/m4/ld-version-script.m4 b/gl/m4/ld-version-script.m4 index fd8c043eac..5ed93efdbb 100644 --- a/gl/m4/ld-version-script.m4 +++ b/gl/m4/ld-version-script.m4 @@ -1,4 +1,4 @@ -# ld-version-script.m4 serial 2 +# ld-version-script.m4 serial 3 dnl Copyright (C) 2008-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -26,6 +26,12 @@ AC_DEFUN([gl_LD_VERSION_SCRIPT], save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map" cat > conftest.map <<EOF +foo +EOF + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], + [accepts_syntax_errors=yes], [accepts_syntax_errors=no]) + if test "$accepts_syntax_errors" = no; then + cat > conftest.map <<EOF VERS_1 { global: sym; }; @@ -34,8 +40,11 @@ VERS_2 { global: sym; } VERS_1; EOF - AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], - [have_ld_version_script=yes], [have_ld_version_script=no]) + AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], + [have_ld_version_script=yes], [have_ld_version_script=no]) + else + have_ld_version_script=no + fi rm -f conftest.map LDFLAGS="$save_LDFLAGS" AC_MSG_RESULT($have_ld_version_script) diff --git a/gl/m4/printf.m4 b/gl/m4/printf.m4 index 6d1fa5497a..d75aca0742 100644 --- a/gl/m4/printf.m4 +++ b/gl/m4/printf.m4 @@ -1,4 +1,4 @@ -# printf.m4 serial 47 +# printf.m4 serial 48 dnl Copyright (C) 2003, 2007-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -1545,7 +1545,7 @@ dnl OpenBSD 3.9, 4.0 . . # # # # . # . # . # . # . dnl Cygwin 1.7.0 (2009) . . . # . . . ? . . . . . ? . . . . . . dnl Cygwin 1.5.25 (2008) . . . # # . . # . . . . . # . . . . . . dnl Cygwin 1.5.19 (2006) # . . # # # . # . # . # # # . . . . . . -dnl Solaris 11 2010-11 . . # # # . . # . . . # . . . . . . . . +dnl Solaris 11 2011-11 . . # # # . . # . . . # . . . . . . . . dnl Solaris 10 . . # # # . . # . . . # # . . . . . . . dnl Solaris 2.6 ... 9 # . # # # # . # . . . # # . . . # . . . dnl Solaris 2.5.1 # . # # # # . # . . . # . . # # # # # # diff --git a/gl/m4/stdlib_h.m4 b/gl/m4/stdlib_h.m4 index bcb4cb854c..85f7126d30 100644 --- a/gl/m4/stdlib_h.m4 +++ b/gl/m4/stdlib_h.m4 @@ -1,4 +1,4 @@ -# stdlib_h.m4 serial 39 +# stdlib_h.m4 serial 40 dnl Copyright (C) 2007-2012 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -101,6 +101,7 @@ AC_DEFUN([gl_STDLIB_H_DEFAULTS], REPLACE_MKSTEMP=0; AC_SUBST([REPLACE_MKSTEMP]) REPLACE_PTSNAME_R=0; AC_SUBST([REPLACE_PTSNAME_R]) REPLACE_PUTENV=0; AC_SUBST([REPLACE_PUTENV]) + REPLACE_RANDOM_R=0; AC_SUBST([REPLACE_RANDOM_R]) REPLACE_REALLOC=0; AC_SUBST([REPLACE_REALLOC]) REPLACE_REALPATH=0; AC_SUBST([REPLACE_REALPATH]) REPLACE_SETENV=0; AC_SUBST([REPLACE_SETENV]) diff --git a/gl/m4/usleep.m4 b/gl/m4/usleep.m4 deleted file mode 100644 index 07fa9e9d43..0000000000 --- a/gl/m4/usleep.m4 +++ /dev/null @@ -1,35 +0,0 @@ -# usleep.m4 serial 2 -dnl Copyright (C) 2009-2012 Free Software Foundation, Inc. -dnl This file is free software; the Free Software Foundation -dnl gives unlimited permission to copy and/or distribute it, -dnl with or without modifications, as long as this notice is preserved. - -dnl This macro intentionally does not check for select or nanosleep; -dnl both of those modules can require external libraries. -AC_DEFUN([gl_FUNC_USLEEP], -[ - AC_REQUIRE([gl_UNISTD_H_DEFAULTS]) - dnl usleep was required in POSIX 2001, but dropped as obsolete in - dnl POSIX 2008; therefore, it is not always exposed in headers. - AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) - AC_CHECK_FUNCS_ONCE([usleep]) - AC_CHECK_TYPE([useconds_t], [], - [AC_DEFINE([useconds_t], [unsigned int], [Define to an unsigned 32-bit - type if <sys/types.h> lacks this type.])]) - if test $ac_cv_func_usleep = no; then - HAVE_USLEEP=0 - else - dnl POSIX allows implementations to reject arguments larger than - dnl 999999, but GNU guarantees it will work. - AC_CACHE_CHECK([whether usleep allows large arguments], - [gl_cv_func_usleep_works], - [AC_RUN_IFELSE([AC_LANG_PROGRAM([[ -#include <unistd.h> -]], [[return !!usleep (1000000);]])], - [gl_cv_func_usleep_works=yes], [gl_cv_func_usleep_works=no], - [gl_cv_func_usleep_works="guessing no"])]) - if test "$gl_cv_func_usleep_works" != yes; then - REPLACE_USLEEP=1 - fi - fi -]) diff --git a/gl/select.c b/gl/select.c index 8bcfef0646..e933094c6d 100644 --- a/gl/select.c +++ b/gl/select.c @@ -102,8 +102,8 @@ IsSocketHandle (HANDLE h) static int windows_poll_handle (HANDLE h, int fd, - struct bitset *rbits, - struct bitset *wbits, + struct bitset *rbits, + struct bitset *wbits, struct bitset *xbits) { BOOL read, write, except; diff --git a/gl/stdlib.in.h b/gl/stdlib.in.h index ea1c1c3be3..0a439e1b0b 100644 --- a/gl/stdlib.in.h +++ b/gl/stdlib.in.h @@ -58,7 +58,7 @@ # include <random.h> # endif -# if !@HAVE_STRUCT_RANDOM_DATA@ || !@HAVE_RANDOM_R@ +# if !@HAVE_STRUCT_RANDOM_DATA@ || @REPLACE_RANDOM_R@ || !@HAVE_RANDOM_R@ # include <stdint.h> # endif @@ -505,11 +505,21 @@ _GL_CXXALIASWARN (putenv); #endif #if @GNULIB_RANDOM_R@ -# if !@HAVE_RANDOM_R@ +# if @REPLACE_RANDOM_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef random_r +# define random_r rpl_random_r +# endif +_GL_FUNCDECL_RPL (random_r, int, (struct random_data *buf, int32_t *result) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (random_r, int, (struct random_data *buf, int32_t *result)); +# else +# if !@HAVE_RANDOM_R@ _GL_FUNCDECL_SYS (random_r, int, (struct random_data *buf, int32_t *result) _GL_ARG_NONNULL ((1, 2))); -# endif +# endif _GL_CXXALIAS_SYS (random_r, int, (struct random_data *buf, int32_t *result)); +# endif _GL_CXXALIASWARN (random_r); #elif defined GNULIB_POSIXCHECK # undef random_r @@ -520,13 +530,25 @@ _GL_WARN_ON_USE (random_r, "random_r is unportable - " #endif #if @GNULIB_RANDOM_R@ -# if !@HAVE_RANDOM_R@ +# if @REPLACE_RANDOM_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef srandom_r +# define srandom_r rpl_srandom_r +# endif +_GL_FUNCDECL_RPL (srandom_r, int, + (unsigned int seed, struct random_data *rand_state) + _GL_ARG_NONNULL ((2))); +_GL_CXXALIAS_RPL (srandom_r, int, + (unsigned int seed, struct random_data *rand_state)); +# else +# if !@HAVE_RANDOM_R@ _GL_FUNCDECL_SYS (srandom_r, int, (unsigned int seed, struct random_data *rand_state) _GL_ARG_NONNULL ((2))); -# endif +# endif _GL_CXXALIAS_SYS (srandom_r, int, (unsigned int seed, struct random_data *rand_state)); +# endif _GL_CXXALIASWARN (srandom_r); #elif defined GNULIB_POSIXCHECK # undef srandom_r @@ -537,15 +559,29 @@ _GL_WARN_ON_USE (srandom_r, "srandom_r is unportable - " #endif #if @GNULIB_RANDOM_R@ -# if !@HAVE_RANDOM_R@ +# if @REPLACE_RANDOM_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef initstate_r +# define initstate_r rpl_initstate_r +# endif +_GL_FUNCDECL_RPL (initstate_r, int, + (unsigned int seed, char *buf, size_t buf_size, + struct random_data *rand_state) + _GL_ARG_NONNULL ((2, 4))); +_GL_CXXALIAS_RPL (initstate_r, int, + (unsigned int seed, char *buf, size_t buf_size, + struct random_data *rand_state)); +# else +# if !@HAVE_RANDOM_R@ _GL_FUNCDECL_SYS (initstate_r, int, (unsigned int seed, char *buf, size_t buf_size, struct random_data *rand_state) _GL_ARG_NONNULL ((2, 4))); -# endif +# endif _GL_CXXALIAS_SYS (initstate_r, int, (unsigned int seed, char *buf, size_t buf_size, struct random_data *rand_state)); +# endif _GL_CXXALIASWARN (initstate_r); #elif defined GNULIB_POSIXCHECK # undef initstate_r @@ -556,13 +592,25 @@ _GL_WARN_ON_USE (initstate_r, "initstate_r is unportable - " #endif #if @GNULIB_RANDOM_R@ -# if !@HAVE_RANDOM_R@ +# if @REPLACE_RANDOM_R@ +# if !(defined __cplusplus && defined GNULIB_NAMESPACE) +# undef setstate_r +# define setstate_r rpl_setstate_r +# endif +_GL_FUNCDECL_RPL (setstate_r, int, + (char *arg_state, struct random_data *rand_state) + _GL_ARG_NONNULL ((1, 2))); +_GL_CXXALIAS_RPL (setstate_r, int, + (char *arg_state, struct random_data *rand_state)); +# else +# if !@HAVE_RANDOM_R@ _GL_FUNCDECL_SYS (setstate_r, int, (char *arg_state, struct random_data *rand_state) _GL_ARG_NONNULL ((1, 2))); -# endif +# endif _GL_CXXALIAS_SYS (setstate_r, int, (char *arg_state, struct random_data *rand_state)); +# endif _GL_CXXALIASWARN (setstate_r); #elif defined GNULIB_POSIXCHECK # undef setstate_r diff --git a/gl/tests/Makefile.am b/gl/tests/Makefile.am index e7f83f31b5..772c9f9d4d 100644 --- a/gl/tests/Makefile.am +++ b/gl/tests/Makefile.am @@ -1342,14 +1342,6 @@ EXTRA_DIST += test-unsetenv.c signature.h macros.h ## end gnulib module unsetenv-tests -## begin gnulib module usleep-tests - -TESTS += test-usleep -check_PROGRAMS += test-usleep -EXTRA_DIST += test-usleep.c signature.h macros.h - -## end gnulib module usleep-tests - ## begin gnulib module vasnprintf-tests TESTS += test-vasnprintf diff --git a/gl/tests/ignore-value.h b/gl/tests/ignore-value.h index 92f2fbca92..52919de8f1 100644 --- a/gl/tests/ignore-value.h +++ b/gl/tests/ignore-value.h @@ -54,9 +54,4 @@ # define ignore_value(x) (({ __typeof__ (x) __x = (x); (void) __x; })) # endif -/* ignore_value works for scalars, pointers and aggregates; - deprecate ignore_ptr. */ -static inline void _GL_ATTRIBUTE_DEPRECATED -ignore_ptr (void *p) { (void) p; } /* deprecated: use ignore_value */ - #endif diff --git a/gl/tests/pipe.c b/gl/tests/pipe.c index eb05f44b06..e7e4253020 100644 --- a/gl/tests/pipe.c +++ b/gl/tests/pipe.c @@ -21,7 +21,7 @@ #include <unistd.h> #if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__ -/* Native Woe32 API. */ +/* Native Windows API. */ /* Get _pipe(). */ # include <io.h> diff --git a/gl/tests/test-init.sh b/gl/tests/test-init.sh index 3368a99acc..c644609fe6 100755 --- a/gl/tests/test-init.sh +++ b/gl/tests/test-init.sh @@ -63,7 +63,7 @@ EOF sed 's/ .*//;/^@@/d' out > k && mv k out # Compare against expected output only if compare is using diff -u. - if (diff -u out out < /dev/null) > /dev/null 2>&1; then + if diff -u out out < /dev/null > /dev/null 2>&1; then compare exp out || fail=1 fi case $- in *x*) ;; *) test -s err && fail_ "err not empty: $(cat err)";; esac diff --git a/gl/tests/test-usleep.c b/gl/tests/test-usleep.c deleted file mode 100644 index 1e4cac1cc2..0000000000 --- a/gl/tests/test-usleep.c +++ /dev/null @@ -1,40 +0,0 @@ -/* Test of usleep() function. - Copyright (C) 2009-2012 Free Software Foundation, Inc. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ - -/* Written by Eric Blake <ebb9@byu.net>, 2009. */ - -#include <config.h> - -#include <unistd.h> - -#include "signature.h" -SIGNATURE_CHECK (usleep, int, (useconds_t)); - -#include <time.h> - -#include "macros.h" - -int -main (void) -{ - time_t start = time (NULL); - ASSERT (usleep (1000000) == 0); - ASSERT (start < time (NULL)); - - ASSERT (usleep (0) == 0); - - return 0; -} diff --git a/gl/usleep.c b/gl/usleep.c deleted file mode 100644 index ea640bfa47..0000000000 --- a/gl/usleep.c +++ /dev/null @@ -1,58 +0,0 @@ -/* Pausing execution of the current thread. - Copyright (C) 2009-2012 Free Software Foundation, Inc. - Written by Eric Blake <ebb9@byu.net>, 2009. - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see <http://www.gnu.org/licenses/>. */ - -/* This file is _intentionally_ light-weight. Rather than using - select or nanosleep, both of which drag in external libraries on - some platforms, this merely rounds up to the nearest second if - usleep() does not exist. If sub-second resolution is important, - then use a more powerful interface to begin with. */ - -#include <config.h> - -/* Specification. */ -#include <unistd.h> - -#include <errno.h> - -#ifndef HAVE_USLEEP -# define HAVE_USLEEP 0 -#endif - -/* Sleep for MICRO microseconds, which can be greater than 1 second. - Return -1 and set errno to EINVAL on range error (about 4295 - seconds), or 0 on success. Interaction with SIGALARM is - unspecified. */ - -int -usleep (useconds_t micro) -{ - unsigned int seconds = micro / 1000000; - if (sizeof seconds < sizeof micro && micro / 1000000 != seconds) - { - errno = EINVAL; - return -1; - } - if (!HAVE_USLEEP && micro % 1000000) - seconds++; - while ((seconds = sleep (seconds)) != 0); - -#undef usleep -#if !HAVE_USLEEP -# define usleep(x) 0 -#endif - return usleep (micro % 1000000); -} @@ -838,7 +838,7 @@ sc_prohibit_cvs_keyword: # # This is a perl script that is expected to be the single-quoted argument # to a command-line "-le". The remaining arguments are file names. -# Print the name of each file that ends in exactly one newline byte. +# Print the name of each file that does not end in exactly one newline byte. # I.e., warn if there are blank lines (2 or more newlines), or if the # last byte is not a newline. However, currently we don't complain # about any file that contains exactly one byte. diff --git a/src/udp-serv.c b/src/udp-serv.c index af033fab23..d6c316125f 100644 --- a/src/udp-serv.c +++ b/src/udp-serv.c @@ -104,7 +104,6 @@ void udp_server(const char* name, int port, int mtu) /* discard peeked data*/ recvfrom(sock, buffer, sizeof(buffer), 0, (struct sockaddr*)&cli_addr, &cli_addr_size); - usleep(100); continue; } printf ("Accepted connection from %s\n", |