Re: [PATCH util-modular v2] release.sh: unset GPGKEY if already existing

2017-04-19 Thread Andres Gomez
On Thu, 2017-04-20 at 08:18 +0300, Andres Gomez wrote:
...
> 
I suppose this other version would work too but, then, we will have a
> different outcome if GPGKEY is set with or without an empty string. In
> that case I would go for an even simpler initialization:
> 
> GPGKEY="" 

Or, simply:

unset GPGKEY

-- 
Br,

Andres
___
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 util-modular v2] release.sh: unset GPGKEY if already existing

2017-04-19 Thread Andres Gomez
On Thu, 2017-04-20 at 10:17 +1000, Peter Hutterer wrote:
> On Wed, Apr 19, 2017 at 03:59:33PM +0300, Andres Gomez wrote:
> > GPGKEY may already exist in the environment. In that case, just
> > unset it.
> > 
> > v2: unsetting is safer than redefining to quietly use a potentially
> > wrong key stored in the variable (Peter).
> > 
> > Signed-off-by: Andres Gomez 
> > Cc: Emil Velikov 
> > Cc: Peter Hutterer 
> > ---
> >  release.sh | 5 +
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/release.sh b/release.sh
> > index f976f94..b8a0aaf 100755
> > --- a/release.sh
> > +++ b/release.sh
> > @@ -808,6 +808,11 @@ if [ "x$GPG" = "x" ] ; then
> >  fi
> >  fi
> >  
> > +# Unset GPGKEY if needed
> > +if [ ! -z ${GPGKEY+x} ] ; then
> > +unset GPGKEY
> > +fi
> 
> wouldn't that fail if GPGKEY is set to the empty string? Plus, I had to look
> up what ${foo+x} actually does :) Should we just stick to the simple well
> known:
> 
> if [ "x$GPGKEY" != "x" ] ; then
> unset GPGKEY
> fi

${foo+x} actually ensures it. That solution always unsets if the
variable is set, empty string or not.

I suppose this other version would work too but, then, we will have a
different outcome if GPGKEY is set with or without an empty string. In
that case I would go for an even simpler initialization:

GPGKEY="" 

That way you ensure that GPGKEY is always set to an empty string.

Let me know what you prefer.

-- 
Br,

Andres
___
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] os: Handle SIGABRT

2017-04-19 Thread Michel Dänzer
From: Michel Dänzer 

Without this, assertion failures make life hard for users and those
trying to help them.

Signed-off-by: Michel Dänzer 
---
 os/osinit.c | 1 +
 os/utils.c  | 6 ++
 2 files changed, 7 insertions(+)

diff --git a/os/osinit.c b/os/osinit.c
index 5b2f6b546..cd769d181 100644
--- a/os/osinit.c
+++ b/os/osinit.c
@@ -173,6 +173,7 @@ OsInit(void)
 int i;
 
 int siglist[] = { SIGSEGV, SIGQUIT, SIGILL, SIGFPE, SIGBUS,
+SIGABRT,
 SIGSYS,
 SIGXCPU,
 SIGXFSZ,
diff --git a/os/utils.c b/os/utils.c
index 3f8bac5c6..226b9c817 100644
--- a/os/utils.c
+++ b/os/utils.c
@@ -1353,6 +1353,12 @@ OsAbort(void)
 #ifndef __APPLE__
 OsBlockSignals();
 #endif
+#if !defined(WIN32) || defined(__CYGWIN__)
+/* abort() raises SIGABRT, so we have to stop handling that to prevent
+ * recursion
+ */
+OsSignal(SIGABRT, SIG_DFL);
+#endif
 abort();
 }
 
-- 
2.11.0

___
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 util-modular v2] release.sh: unset GPGKEY if already existing

2017-04-19 Thread Peter Hutterer
On Wed, Apr 19, 2017 at 03:59:33PM +0300, Andres Gomez wrote:
> GPGKEY may already exist in the environment. In that case, just
> unset it.
> 
> v2: unsetting is safer than redefining to quietly use a potentially
> wrong key stored in the variable (Peter).
> 
> Signed-off-by: Andres Gomez 
> Cc: Emil Velikov 
> Cc: Peter Hutterer 
> ---
>  release.sh | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/release.sh b/release.sh
> index f976f94..b8a0aaf 100755
> --- a/release.sh
> +++ b/release.sh
> @@ -808,6 +808,11 @@ if [ "x$GPG" = "x" ] ; then
>  fi
>  fi
>  
> +# Unset GPGKEY if needed
> +if [ ! -z ${GPGKEY+x} ] ; then
> +unset GPGKEY
> +fi

wouldn't that fail if GPGKEY is set to the empty string? Plus, I had to look
up what ${foo+x} actually does :) Should we just stick to the simple well
known:

if [ "x$GPGKEY" != "x" ] ; then
unset GPGKEY
fi

Cheers,
   Peter

> +
>  # Set the default make tarball creation command
>  MAKE_DIST_CMD=distcheck
>  
> -- 
> 2.11.0
> 
___
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 xproto] Add XF86XK_Keyboard

2017-04-19 Thread Christian Kellner
From: Christian Kellner 

The 2017 Thinkpad models have a new hotkey with a keyboard symbols
on it, which is mapped to KEY_KEYBOARD in the kernel.

Signed-off-by: Christian Kellner 
---
 XF86keysym.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/XF86keysym.h b/XF86keysym.h
index 8b5646e..89d40b8 100644
--- a/XF86keysym.h
+++ b/XF86keysym.h
@@ -197,6 +197,8 @@
 
 #define XF86XK_AudioMicMute0x1008FFB2   /* Mute the Mic from the system */
 
+#define XF86XK_Keyboard0x1008FFB3   /* User defined keyboard 
related action */
+
 /* Keys for special action keys (hot keys) */
 /* Virtual terminals on some operating systems */
 #define XF86XK_Switch_VT_1 0x1008FE01
-- 
2.9.3

___
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 util-modular v2] release.sh: unset GPGKEY if already existing

2017-04-19 Thread Emil Velikov
On 19 April 2017 at 13:59, Andres Gomez  wrote:
> GPGKEY may already exist in the environment. In that case, just
> unset it.
>
> v2: unsetting is safer than redefining to quietly use a potentially
> wrong key stored in the variable (Peter).
>
> Signed-off-by: Andres Gomez 
> Cc: Emil Velikov 
> Cc: Peter Hutterer 
Either solution is fine with me.

Reviewed-by: Emil Velikov 

Thanks
Emil
___
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 2/4] hw/xwin: Fix -Wmaybe-uninitialized warning in winWindowProc

2017-04-19 Thread Jon Turney

On 18/04/2017 22:08, Adam Jackson wrote:

On Tue, 2017-04-18 at 11:53 +0100, Jon Turney wrote:

This is possibly an actual bug in failing to check we successfully retrieved
the monitor size before using it to set the X screen size.


It is indeed.


@@ -261,6 +261,9 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, 
LPARAM lParam)
 ErrorF("Monitor number %d no longer exists!\n",
s_pScreenInfo->iMonitor);
 }
+ErrorF("QueryMonitor %d failed!\n",
+   s_pScreenInfo->iMonitor);
+


This is inside if (QueryMonitor()), which returns true most of the
time. It only returns false if the second argument is null (which it
won't ever be since it's on the stack), and also ignores the return
value from EnumDisplayMonitors. So basically you're now printing that
it fails on every call.


Oops!

But yes, even if I'd managed to correctly put this in an else clause, 
this is pointless (and checking the return value of 
EnumDisplayMonitors() turns out the be not very useful either, see 
5940580f), so I'll drop that part, and maybe make a patch to make 
QueryMonitor() less insane later...


Thanks for catching this.

Amended patch attached.

From 4df504fda1a4a913f803b50da8081fe39927f50a Mon Sep 17 00:00:00 2001
From: Jon Turney 
Date: Wed, 19 Apr 2017 13:30:27 +0100
Subject: [PATCH xserver 2/4] hw/xwin: Fix -Wmaybe-uninitialized warning in
 winWindowProc
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

This is possibly an actual bug in failing to check we successfuly retrieved
the monitor size before using it to set the X screen size.

../hw/xwin/winwndproc.c: In function ‘winWindowProc’:
../hw/xwin/winwndproc.c:283:55: warning: ‘dwHeight’ may be used uninitialized 
in this function [-Wmaybe-uninitialized]
../hw/xwin/winwndproc.c:240:32: note: ‘dwHeight’ was declared here
../hw/xwin/winwndproc.c:281:54: warning: ‘dwWidth’ may be used uninitialized in 
this function [-Wmaybe-uninitialized]
../hw/xwin/winwndproc.c:240:23: note: ‘dwWidth’ was declared here

Signed-off-by: Jon Turney 
---
 hw/xwin/winwndproc.c | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/hw/xwin/winwndproc.c b/hw/xwin/winwndproc.c
index 7236a95..ad9f1b3 100644
--- a/hw/xwin/winwndproc.c
+++ b/hw/xwin/winwndproc.c
@@ -237,7 +237,7 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, 
LPARAM lParam)
 
fMultiWindow
 #endif
 )) {
-DWORD dwWidth, dwHeight;
+DWORD dwWidth = 0, dwHeight = 0;
 
 if (s_pScreenInfo->fMultipleMonitors) {
 /* resize to new virtual desktop size */
@@ -273,8 +273,9 @@ winWindowProc(HWND hwnd, UINT message, WPARAM wParam, 
LPARAM lParam)
  */
 
 /* Set screen size to match new size, if it is different to 
current */
-if ((s_pScreenInfo->dwWidth != dwWidth) ||
-(s_pScreenInfo->dwHeight != dwHeight)) {
+if (((dwWidth != 0) && (dwHeight != 0)) &&
+((s_pScreenInfo->dwWidth != dwWidth) ||
+ (s_pScreenInfo->dwHeight != dwHeight))) {
 winDoRandRScreenSetSize(s_pScreen,
 dwWidth,
 dwHeight,
-- 
2.8.3

___
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 util-modular v2] release.sh: unset GPGKEY if already existing

2017-04-19 Thread Andres Gomez
GPGKEY may already exist in the environment. In that case, just
unset it.

v2: unsetting is safer than redefining to quietly use a potentially
wrong key stored in the variable (Peter).

Signed-off-by: Andres Gomez 
Cc: Emil Velikov 
Cc: Peter Hutterer 
---
 release.sh | 5 +
 1 file changed, 5 insertions(+)

diff --git a/release.sh b/release.sh
index f976f94..b8a0aaf 100755
--- a/release.sh
+++ b/release.sh
@@ -808,6 +808,11 @@ if [ "x$GPG" = "x" ] ; then
 fi
 fi
 
+# Unset GPGKEY if needed
+if [ ! -z ${GPGKEY+x} ] ; then
+unset GPGKEY
+fi
+
 # Set the default make tarball creation command
 MAKE_DIST_CMD=distcheck
 
-- 
2.11.0

___
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 util-modular] release.sh: redefine GPGKEY if already existing

2017-04-19 Thread Andres Gomez
On Tue, 2017-04-18 at 12:08 +1000, Peter Hutterer wrote:
> On Fri, Apr 07, 2017 at 04:26:35PM +0300, Andres Gomez wrote:
> > GPGKEY may already exist in the environment. In that case, just
> > redefine it adding "-u"
> 
> Is GPGKEY a common thing used in other scripts? I honestly don't know. If
> not, then I wonder if redefining it is risky to pick the wrong key and it
> may be better to just zero it out, requiring the use of --gpgkey for th
> release script.

GPGKEY is mentioned in several receipts and scripts such as:
https://help.ubuntu.com/community/GnuPrivacyGuardHowto#Setting_the_key_to_be_the_default
https://wiki.debian.org/DebianRepository/SetupWithMinidinstall

But it is true that it is not used in other scripts in util-modular and
I have not found an actual use in other widespread scripts and programs
so I can agree zeroing it out is harmless and safer.

I new patch will follow.

-- 
Br,

Andres
___
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