mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-01-03 22:00:16 +01:00
test-utils-glibc.c: Fix -Werror,-Wmissing-noreturn on FreeBSD
Add a conditional _DBUS_GNUC_NORETURN to avoid `error: function 'back_to_root' could be declared with attribute 'noreturn'`
This commit is contained in:
parent
cf51eeb555
commit
aec2ad7efb
1 changed files with 10 additions and 6 deletions
|
|
@ -553,16 +553,20 @@ become_other_user (TestUser user,
|
|||
}
|
||||
|
||||
/* Undo the effect of a successful call to become_other_user() */
|
||||
#if defined(HAVE_GETRESUID) && defined(HAVE_SETRESUID) && defined(__linux__)
|
||||
static void
|
||||
back_to_root (void)
|
||||
{
|
||||
#if defined(HAVE_GETRESUID) && defined(HAVE_SETRESUID) && defined(__linux__)
|
||||
if (setresuid (0, 0, 0) != 0)
|
||||
g_error ("setresuid(0, 0, 0): %s", g_strerror (errno));
|
||||
#else
|
||||
g_error ("become_other_user() cannot succeed on this platform");
|
||||
#endif
|
||||
if (setresuid(0, 0, 0) != 0)
|
||||
g_error ("setresuid(0, 0, 0): %s", g_strerror(errno));
|
||||
}
|
||||
#else
|
||||
_DBUS_GNUC_NORETURN static void
|
||||
back_to_root (void)
|
||||
{
|
||||
g_error ("become_other_user() cannot succeed on this platform");
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Raise G_IO_ERROR_NOT_SUPPORTED if the requested user is impossible.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue