Re: [PATCH xserver v2] fixing -logfile when used with -displayfd

2018-03-28 Thread Adam Jackson
On Sun, 2018-03-25 at 21:09 -0700, Alan Coopersmith wrote:
> Reviewed-by: Alan Coopersmith 

Patchwork hated this patch, for whatever reason. Applied by hand and
fixed up the commit message a bit, thanks:

remote: E: failed to find patch for rev 
c95361465ee98dd97a99778d8a31be88fe9e4c4f.
remote: I: 0 patch(es) updated to state Accepted.
To ssh://git.freedesktop.org/git/xorg/xserver
   b355e55f50..c95361465e  master -> master

- ajax
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Re: [PATCH xserver v2] fixing -logfile when used with -displayfd

2018-03-25 Thread Alan Coopersmith
Reviewed-by: Alan Coopersmith 

On 02/28/18 12:19 AM, Antoine Martin wrote:
> Hi,
> 
> v2 updated with the feedback from Alan: the LogSetDisplay function is
> the right place for this fix.
> 
> 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
> 
> And below is the trivial fix for it. We only need to rename the logfile
> if the log filename contains the magic substitution string "%s".
> 
> Signed-off-by: Antoine Martin 
> ---
> 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);
> 


-- 
-Alan Coopersmith-   alan.coopersm...@oracle.com
 Oracle Solaris Engineering - https://blogs.oracle.com/alanc
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

[PATCH xserver v2] fixing -logfile when used with -displayfd

2018-02-28 Thread Antoine Martin
Hi,

v2 updated with the feedback from Alan: the LogSetDisplay function is
the right place for this fix.

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

And below is the trivial fix for it. We only need to rename the logfile
if the log filename contains the magic substitution string "%s".

Signed-off-by: Antoine Martin 
---
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);
___
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel