os: Clear the -displayfd option after closing the file
authorKeith Packard <keithp@keithp.com>
Fri, 18 Apr 2014 22:00:35 +0000 (15:00 -0700)
committerKeith Packard <keithp@keithp.com>
Fri, 18 Apr 2014 23:30:17 +0000 (16:30 -0700)
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: Keith Packard <keithp@keithp.com>
Reviewed-by: Jamey Sharp <jamey@minilop.net>
os/connection.c

index e914d9d..5294e59 100644 (file)
@@ -356,6 +356,7 @@ NotifyParentProcess(void)
         write(displayfd, display, strlen(display));
         write(displayfd, "\n", 1);
         close(displayfd);
+        displayfd = -1;
     }
     if (RunFromSmartParent) {
         if (ParentProcess > 1) {