Commit a95cfdf4 authored by Keith Packard's avatar Keith Packard Committed by Mike Gabriel

os: FatalError if -displayfd writes fail AND Clear the -displayfd option after closing the file

commit d72f691c0c9cace857975a6608a4cb431c8b6846 Author: Keith Packard <keithp@keithp.com> Date: Fri Apr 18 15:00:30 2014 -0700 os: FatalError if -displayfd writes fail When the server is started with the -displayfd option, check to make sure that the writes succeed and give up running if they don't. Signed-off-by: 's avatarKeith Packard <keithp@keithp.com> Reviewed-by: 's avatarJamey Sharp <jamey@minilop.net> commit 4957e986841225e9984daca76f1a0ee08df125bb Author: Keith Packard <keithp@keithp.com> Date: Fri Apr 18 15:00:35 2014 -0700 os: Clear the -displayfd option after closing the file Failing to clear this means that we'll attempt to write the display number to a random file descriptor on subsequent X server generations. Signed-off-by: 's avatarKeith Packard <keithp@keithp.com> Reviewed-by: 's avatarJamey Sharp <jamey@minilop.net> Backported-to-NX-by: 's avatarMike Gabriel <mike.gabriel@das-netzwerkteam.de>
parent e96e810c
......@@ -364,8 +364,12 @@ NotifyParentProcess(void)
{
#if !defined(WIN32)
if (displayfd >= 0) {
write(displayfd, display, strlen(display));
if (write(displayfd, display, strlen(display)) != strlen(display))
FatalError("Cannot write display number to fd %d\n", displayfd);
if (write(displayfd, "\n", 1) != 1)
FatalError("Cannot write display number to fd %d\n", displayfd);
close(displayfd);
displayfd = -1;
}
if (RunFromSmartParent) {
if (ParentProcess > 1) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment