-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

On Jul 29, 2010, at 3:54 PM, Alan Coopersmith wrote:

Matthieu Herrb wrote:
From 017b77fa3323f34f7cf09efbe0e3358a3ea733f8 Mon Sep 17 00:00:00 2001
From: David Coppa <[email protected]>
Date: Thu, 29 Jul 2010 21:46:11 +0200
Subject: [PATCH xclock] Fix a crash on sparc64.

The pid variable that is passed to XChangeProperty() is not a long.
The libX11 code deferences the variable as a long and on a 64-bit sparc
this must be aligned on a 8-byte boundary.

Signed-off-by: Matthieu Herrb <[email protected]>
---
xclock.c |    2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xclock.c b/xclock.c
index 6b80ad0..5965a83 100644
--- a/xclock.c
+++ b/xclock.c
@@ -215,7 +215,7 @@ main(int argc, char *argv[])

#ifdef HAVE_GETPID
    {
-       pid_t pid = getpid();
+       unsigned long pid = (unsigned long)getpid();
        XChangeProperty(XtDisplay(toplevel), XtWindow(toplevel),
                        XInternAtom(XtDisplay(toplevel), "_NET_WM_PID", False),
                        XA_CARDINAL, 32, PropModeReplace,

Oops. Oh how I wish we could undo xlib's "CARD32 is always long" confusion...

Yeah, that's the single most counter-intuitive 'feature' in libX11. You don't want to know how many times I had for fix bugs like that.

have fun
Michael

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)

iQEVAwUBTFHfscpnzkX8Yg2nAQJUVQf/Vw7psK+XQMrRDigoFDO9R30NYix/eMib
7pB+n80vHFBZ9BdLFhuxm2KgBGGfzOi31cZ/JNUQYgUM8UIBU0hkQmZm2daJ3HME
VUnanqS9p36CB+nV4GVlBH3l1miQpF7cNgDWkE6prkXdQZi/l3aGGpjTPfZRUIfK
CzIYDqAF0biBWXfFHunxDXJYM1ibcs9ooaHlHBPNgNs3tCDDdf20J3cJmL9gv96q
7FZ3r0cmhN2KFk21cURky+lnXUkIsu66pTKtiZVYYYT7ZpIXwIpb7nH0FtM9Bfpx
mgAEzirESlwsMjdDja/UWdTnMhsPr7wsn00v8ASTEBRwz3s+tdvsng==
=rvk7
-----END PGP SIGNATURE-----
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to