X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=tests%2Ftest-sethostname2.c;h=a96f36ae3d1f87bc53cc162789f2aa80858a46ea;hb=c50edd6462eaaae00f8549f9bad99d4e68b94376;hp=ca2279f3b61d6f5a0ca1ad3322e3f305ee2f5806;hpb=1602f0afed21be664fcf5c42d59db07cc22c56d6;p=gnulib.git diff --git a/tests/test-sethostname2.c b/tests/test-sethostname2.c index ca2279f3b..a96f36ae3 100644 --- a/tests/test-sethostname2.c +++ b/tests/test-sethostname2.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2012 Free Software Foundation, Inc. + * Copyright (C) 2011-2013 Free Software Foundation, Inc. * Written by Ben Walton. * * This program is free software: you can redistribute it and/or modify @@ -27,6 +27,8 @@ #include #include +#include "root-uid.h" + #include "macros.h" #define TESTHOSTNAME "gnulib-hostname" @@ -35,7 +37,7 @@ On Cygwin, geteuid() may return non-zero even for user accounts with administrator privileges, so use a dummy value as well. */ #if !HAVE_GETEUID || defined __CYGWIN__ -# define geteuid() 0 +# define geteuid() ROOT_UID #endif int @@ -50,7 +52,7 @@ main (int argc, char *argv[] _GL_UNUSED) consider things like CAP_SYS_ADMIN (linux) or PRIV_SYS_ADMIN (solaris), etc. systems without a working geteuid (mingw, MSVC 9) will always skip this test. */ - if (geteuid () != 0) + if (geteuid () != ROOT_UID) { fprintf (stderr, "Skipping test: insufficient permissions.\n"); return 77;