Commit c9536146 authored by Antoine Martin's avatar Antoine Martin Committed by Adam Jackson
Browse files

os: Fix -logfile when used with -displayfd

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 directory

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:

To fix this, only rename the logfile if the log filename contains the
magic substitution string "%s".
Signed-off-by: Antoine Martin's avatarAntoine Martin <>
Reviewed-by: Alan Coopersmith's avatarAlan Coopersmith <>
parent b355e55f
......@@ -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, display);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment