Mercurial > hg > octave-kai > gnulib-hg
changeset 16151:5e77939eb443
sethostname tests: Fix compilation error on mingw.
* tests/test-sethostname.c: Don't include <sys/types.h>.
(geteuid): Use a dummy value without uid_t.
* modules/sethostname-tests (Depends-on): Remove sys_types.
author | Bruno Haible <bruno@clisp.org> |
---|---|
date | Sat, 03 Dec 2011 15:28:47 +0100 |
parents | ceb95637edc6 |
children | cd99c80c513b |
files | ChangeLog modules/sethostname-tests tests/test-sethostname.c |
diffstat | 3 files changed, 7 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2011-12-03 Bruno Haible <bruno@clisp.org> + sethostname tests: Fix compilation error on mingw. + * tests/test-sethostname.c: Don't include <sys/types.h>. + (geteuid): Use a dummy value without uid_t. + * modules/sethostname-tests (Depends-on): Remove sys_types. + sethostname tests: Avoid a gcc warning. * tests/test-sethostname.c (main): Remove an unused variable.
--- a/modules/sethostname-tests +++ b/modules/sethostname-tests @@ -4,7 +4,6 @@ tests/macros.h Depends-on: -sys_types configure.ac: AC_CHECK_FUNCS_ONCE([geteuid])
--- a/tests/test-sethostname.c +++ b/tests/test-sethostname.c @@ -24,8 +24,6 @@ /* for HOST_NAME_MAX */ #include <limits.h> -/* for uid_t */ -#include <sys/types.h> /* for strlen */ #include <string.h> @@ -36,11 +34,9 @@ #define TESTHOSTNAME "gnulib-hostname" -/* mingw and MSVC 9 lack geteuid, so setup a value that will indicate - we don't have root privilege since we wouldn't know whether to - expect success or failure when setting a name anyway*/ +/* mingw and MSVC 9 lack geteuid, so setup a dummy value. */ #if !HAVE_GETEUID -# define geteuid() ((uid_t) -1) +# define geteuid() 0 #endif int