diff options
author | jdc <jdc> | 2012-02-20 14:55:59 +0000 |
---|---|---|
committer | jdc <jdc> | 2012-02-20 14:55:59 +0000 |
commit | b49e0c604f44c1bd12b161b705f606fd1061aa96 (patch) | |
tree | bc4cc0887c0a1f16f454ae579e0adb10ca59b85b /devel | |
parent | 3656877724fcbc6ac03e3c3c1e33961f1744d2cc (diff) | |
download | pkgsrc-b49e0c604f44c1bd12b161b705f606fd1061aa96.tar.gz |
Fix bus error crash on sparc64, by aligning the object we pass to:
XChangeProperty(..., 32, ...)
correctly. See also libSDL bug 1427:
http://bugzilla.libsdl.org/show_bug.cgi?id=1427
Diffstat (limited to 'devel')
-rw-r--r-- | devel/SDL/patches/patch-src_video_x11_SDL_x11video.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/devel/SDL/patches/patch-src_video_x11_SDL_x11video.c b/devel/SDL/patches/patch-src_video_x11_SDL_x11video.c new file mode 100644 index 00000000000..33e6cb756b9 --- /dev/null +++ b/devel/SDL/patches/patch-src_video_x11_SDL_x11video.c @@ -0,0 +1,31 @@ +$NetBSD: patch-src_video_x11_SDL_x11video.c,v 1.1 2012/02/20 14:55:59 jdc Exp $ + +We need to call XChangeProperty(..., 32, ...) with an object aligned as long. + +--- src/video/x11/SDL_x11video.c.orig 2012-02-14 22:26:01.000000000 +0000 ++++ src/video/x11/SDL_x11video.c 2012-02-14 22:53:45.000000000 +0000 +@@ -418,16 +418,21 @@ + } + + { +- pid_t pid = getpid(); ++ union align_pid { ++ pid_t pid; ++ long dummy; ++ } a_pid; ++ ++ a_pid.pid = getpid(); + char hostname[256]; + +- if (pid > 0 && gethostname(hostname, sizeof(hostname)) > -1) { ++ if (a_pid.pid > 0 && gethostname(hostname, sizeof(hostname)) > -1) { + Atom _NET_WM_PID = XInternAtom(SDL_Display, "_NET_WM_PID", False); + Atom WM_CLIENT_MACHINE = XInternAtom(SDL_Display, "WM_CLIENT_MACHINE", False); + + hostname[sizeof(hostname)-1] = '\0'; + XChangeProperty(SDL_Display, WMwindow, _NET_WM_PID, XA_CARDINAL, 32, +- PropModeReplace, (unsigned char *)&pid, 1); ++ PropModeReplace, (unsigned char *)&(a_pid.pid), 1); + XChangeProperty(SDL_Display, WMwindow, WM_CLIENT_MACHINE, XA_STRING, 8, + PropModeReplace, (unsigned char *)hostname, SDL_strlen(hostname)); + } |