[PATCH xserver] modesetting: Allow a DRM fd to be passed on command line with -masterfd

Keith Packard keithp at keithp.com
Thu Jun 28 19:39:00 UTC 2018


Lyude Paul <lyude at redhat.com> writes:

> Looks good! One nitpick I'm not 100% sure about:

>> +#define CHECK_FOR_REQUIRED_ARGUMENT() \
>> +    if (((i + 1) >= argc) || (!argv[i + 1])) { 				
>> \
>> +      ErrorF("Required argument to %s not specified\n", argv[i]); 	\
>> +      UseMsg(); 							\
>> +      FatalError("Required argument to %s not specified\n", argv[i]);	
> Is the double printing of "Required argument to %s not specified" here
> intentional?

I copied CHECK_FOR_REQUIRED_ARGUMENT from xf86Init.c where it does the
same thing. I assume this is intended to make sure the user understands
what error caused the server to exit -- you can see it both before and
after the long usage message.

>> +    if (!xf86PrivsElevated())
>> +        ErrorF("-masterfd <fd>         use the specified fd as the DRM
>> master fd\n");
> I think it would be a better idea for us to show this argument description
> unconditionally, along with adding a note about setuid/setgid not being
> allowed with it

Sounds good. 

Here's an updated patch with the usage message change suggested. Thanks
for reviewing!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-modesetting-Allow-a-DRM-fd-to-be-passed-on-command-l.patch
Type: text/x-diff
Size: 5839 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg-devel/attachments/20180628/8cab7a07/attachment.patch>
-------------- next part --------------

-- 
-keith
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 832 bytes
Desc: not available
URL: <https://lists.x.org/archives/xorg-devel/attachments/20180628/8cab7a07/attachment.sig>


More information about the xorg-devel mailing list