xserver: Branch 'master'

Adam Jackson ajax at kemper.freedesktop.org
Wed Mar 28 19:17:47 UTC 2018


 os/log.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c95361465ee98dd97a99778d8a31be88fe9e4c4f
Author: Antoine Martin <antoine at nagafix.co.uk>
Date:   Wed Mar 28 15:16:02 2018 -0400

    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:
    
    https://cgit.freedesktop.org/xorg/xserver/commit/?id=edcb6426f20c3be5dd5f50b76a686754aef2f64e
    
    To fix this, only rename the logfile if the log filename contains the
    magic substitution string "%s".
    
    Signed-off-by: Antoine Martin <antoine at nagafix.co.uk>
    Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com>

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)
 void
 LogSetDisplay(void)
 {
-    if (saved_log_fname) {
+    if (saved_log_fname && strstr(saved_log_fname, "%s")) {
         char *logFileName;
 
         logFileName = LogFilePrep(saved_log_fname, saved_log_backup, display);


More information about the xorg-commit mailing list