I realize I'm rather late to the party, but this change causes troubles
with Xspice.
That is, Xorg, on startup, closes stdout.
Since the g_log_default_handler writes to stdout for DEBUG and INFO
messages, those messages never show up anywhere.
The attached patch 'fixes' it. I'm a bit hesitant to pursue this
approach; I do not know if using stdout will have a negative side effect
on the Xorg server.
Anyone else have insight? I'll more formally submit this if I don't
hear anything back.
Cheers,
Jeremy
diff --git a/src/spiceqxl_spice_server.c b/src/spiceqxl_spice_server.c
index b2b31ff..f9ddba1 100644
--- a/src/spiceqxl_spice_server.c
+++ b/src/spiceqxl_spice_server.c
@@ -28,6 +28,8 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
+#include <unistd.h>
+
#include "qxl.h"
#include "qxl_option_helpers.h"
@@ -39,6 +41,9 @@ SpiceServer *xspice_get_spice_server(void)
{
static SpiceServer *spice_server;
if (!spice_server) {
+ /* Xorg closes stdout on us. We reopen it to point at stderr, so that
+ g_log_default_handler will send it's output somewhere useful */
+ dup2(2, 1);
spice_server = spice_server_new();
}
return spice_server;
_______________________________________________
Spice-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/spice-devel