[PATCH v2] os: print newline after printing display name

Peter Hutterer peter.hutterer at who-t.net
Thu Jun 21 02:40:29 PDT 2012


On 21/06/12 17:11 , walter harms wrote:
> Am 21.06.2012 07:30, schrieb Peter Hutterer:
>> Much easier for scripts that try to read the display value off the file
>> descriptor. Plus, this restores the behaviour we had for this patch in
>> Fedora since server 1.6 (April 2009).
>>
>> Signed-off-by: Peter Hutterer<peter.hutterer at who-t.net>
>> ---
>> alanc pointed me to why the \n wasn't part of dynamic_display, thanks.
>> See http://patchwork.freedesktop.org/patch/9740/ for Jon's original comment.
>>
>> Changes to v1:
>> - don't store \n in dynamic_display, just write it out instead
>>
>>   os/connection.c |    1 +
>>   1 file changed, 1 insertion(+)
>>
>> diff --git a/os/connection.c b/os/connection.c
>> index 039942f..3441472 100644
>> --- a/os/connection.c
>> +++ b/os/connection.c
>> @@ -353,6 +353,7 @@ NotifyParentProcess(void)
>>   #if !defined(WIN32)
>>       if (dynamic_display[0]) {
>>           write(displayfd, dynamic_display, strlen(dynamic_display));
>> +        write(displayfd, "\n", 1);
>>           close(displayfd);
>>       }
>>       if (RunFromSmartParent) {
>
> I am confused oin the other patch you have just added "\n" to dynamic_display.
> btw an other to handle that is using the dprintf() from POSIX 2001 but i am not sure
> if xorg is ready to support this now.

this patch replaces the other patch.

http://linux.die.net/man/3/dprintf claims:
"These functions are GNU extensions that are nowadays specified in 
POSIX.1-2008." so we'd have to wrap it, etc. not really worth the effort 
for a single line break, tbh.

Cheers,
   Peter


More information about the xorg-devel mailing list