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: Keith Packard <keithp@keithp.com> Reviewed-by: Jamey Sharp <jamey@minilop.net>
This commit is contained in:
parent
4957e98684
commit
d72f691c0c
|
@ -353,8 +353,10 @@ NotifyParentProcess(void)
|
||||||
{
|
{
|
||||||
#if !defined(WIN32)
|
#if !defined(WIN32)
|
||||||
if (displayfd >= 0) {
|
if (displayfd >= 0) {
|
||||||
write(displayfd, display, strlen(display));
|
if (write(displayfd, display, strlen(display)) != strlen(display))
|
||||||
write(displayfd, "\n", 1);
|
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);
|
close(displayfd);
|
||||||
displayfd = -1;
|
displayfd = -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue