mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-30 22:43:12 +03:00
hurd: fix resolv/tst-resolv-res_init-skeleton.c build
* resolv/tst-resolv-res_init-skeleton.c (run_res_init) [!CLONE_NEWUTS]: Fail as unsupported if hostname is not NULL.
This commit is contained in:
@ -35,6 +35,8 @@
|
|||||||
RWF_NOWAIT): Define to 0 if undefined already.
|
RWF_NOWAIT): Define to 0 if undefined already.
|
||||||
(do_test_with_invalid_flags): Set invalid_flag to 2 if RWF_SUPPORTED
|
(do_test_with_invalid_flags): Set invalid_flag to 2 if RWF_SUPPORTED
|
||||||
boils down to 0.
|
boils down to 0.
|
||||||
|
* resolv/tst-resolv-res_init-skeleton.c (run_res_init)
|
||||||
|
[!CLONE_NEWUTS]: Fail as unsupported if hostname is not NULL.
|
||||||
|
|
||||||
2017-09-01 Joseph Myers <joseph@codesourcery.com>
|
2017-09-01 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
|
@ -341,11 +341,15 @@ run_res_init (void *closure)
|
|||||||
setenv ("RES_OPTIONS", ctx->t->res_options, 1);
|
setenv ("RES_OPTIONS", ctx->t->res_options, 1);
|
||||||
if (ctx->t->hostname != NULL)
|
if (ctx->t->hostname != NULL)
|
||||||
{
|
{
|
||||||
|
#ifdef CLONE_NEWUTS
|
||||||
/* This test needs its own namespace, to avoid changing the host
|
/* This test needs its own namespace, to avoid changing the host
|
||||||
name for the parent, too. */
|
name for the parent, too. */
|
||||||
TEST_VERIFY_EXIT (unshare (CLONE_NEWUTS) == 0);
|
TEST_VERIFY_EXIT (unshare (CLONE_NEWUTS) == 0);
|
||||||
if (sethostname (ctx->t->hostname, strlen (ctx->t->hostname)) != 0)
|
if (sethostname (ctx->t->hostname, strlen (ctx->t->hostname)) != 0)
|
||||||
FAIL_EXIT1 ("sethostname (\"%s\"): %m", ctx->t->hostname);
|
FAIL_EXIT1 ("sethostname (\"%s\"): %m", ctx->t->hostname);
|
||||||
|
#else
|
||||||
|
FAIL_UNSUPPORTED ("clone (CLONE_NEWUTS) not supported");
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (ctx->init)
|
switch (ctx->init)
|
||||||
|
Reference in New Issue
Block a user