I hit this corner case when testing a single X server spanning both intel
gfx + an usb display link adapter driven by xf86-video-modesetting.
In this scenario the intel driver gets its platformProbe method called first,
and if it then closes the server managed fd, the xf86-video-modesetting gets
EBADFD errors.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
return fd;
err_close:
- close(fd);
+ if (master_count == 0) /* Don't close server-fds */
+ close(fd);
err_path:
free(local_path);
return -1;