xfree86: drop unneeded wrapper xf86PrivsElevated()

It's just a dumb wrapper around PrivsElevated(), and also just called in few
places, while others call PrivsElevated() directly - thus not needed and
can be dropped.

Note that it's also not called by drivers, so the export was unnecessary.

Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1324>
This commit is contained in:
Enrico Weigelt, metux IT consult 2024-02-26 12:26:06 +01:00 committed by Marge Bot
parent 96b9bbe9fa
commit 4705fa933a
3 changed files with 3 additions and 11 deletions

View File

@ -187,12 +187,6 @@ xf86PrintBanner(void)
"\tto make sure that you have the latest version.\n");
}
Bool
xf86PrivsElevated(void)
{
return PrivsElevated();
}
Bool
xf86HasTTYs(void)
{
@ -926,7 +920,7 @@ ddxProcessArgument(int argc, char **argv, int i)
/* First the options that are not allowed with elevated privileges */
if (!strcmp(argv[i], "-modulepath")) {
CHECK_FOR_REQUIRED_ARGUMENTS(1);
if (xf86PrivsElevated())
if (PrivsElevated())
FatalError("\nInvalid argument -modulepath "
"with elevated privileges\n");
xf86ModulePath = argv[i + 1];
@ -935,7 +929,7 @@ ddxProcessArgument(int argc, char **argv, int i)
}
if (!strcmp(argv[i], "-logfile")) {
CHECK_FOR_REQUIRED_ARGUMENTS(1);
if (xf86PrivsElevated())
if (PrivsElevated())
FatalError("\nInvalid argument -logfile "
"with elevated privileges\n");
xf86LogFile = argv[i + 1];

View File

@ -158,8 +158,6 @@ xf86SetLogVerbosity(int verb);
extern _X_EXPORT Bool
xf86CallDriverProbe(struct _DriverRec *drv, Bool detect_only);
extern _X_EXPORT Bool
xf86PrivsElevated(void);
extern _X_EXPORT Bool
xf86HasTTYs(void);
#endif /* _NO_XF86_PROTOTYPES */

View File

@ -386,7 +386,7 @@ xf86ProcessArgument(int argc, char *argv[], int i)
if (!strcmp(argv[i], "-masterfd")) {
CHECK_FOR_REQUIRED_ARGUMENT();
if (xf86PrivsElevated())
if (PrivsElevated())
FatalError("\nCannot specify -masterfd when server is setuid/setgid\n");
if (sscanf(argv[++i], "%d", &xf86DRMMasterFd) != 1) {
UseMsg();