[PATCH] fixing -logfile when used with -displayfd

Antoine Martin antoine at devloop.org.uk
Sat Aug 5 10:09:57 UTC 2017


Trivial way to reproduce the bug:
Xorg -logfile /tmp/mylog -config /etc/xpra/xorg.conf -displayfd 2

The server then moans:
Failed to rename log file "/tmp/mylog" to "/tmp/mylog": No such file or

And the log file is created, but immediately renamed to "/tmp/mylog.old"

This is caused by the changes to the log file handling introduced by
this commit:
And below is the trivial fix for it.

Don't try to add the pidstring to the log filename if it doesn't contain
the "%s" placeholder for it.

Signed-off-by: Antoine Martin <antoine at nagafix.co.uk>
diff --git a/os/log.c b/os/log.c
index 91e55a532..a3b28ccb4 100644
--- a/os/log.c
+++ b/os/log.c
@@ -296,7 +296,7 @@ LogInit(const char *fname, const char *backup)
-    if (saved_log_fname) {
+    if (saved_log_fname && strstr(saved_log_fname, "%s")) {
         char *logFileName;

         logFileName = LogFilePrep(saved_log_fname, saved_log_backup,

More information about the xorg-devel mailing list