SDL_Quit.c breaks the build (SDL 1.2 trunk)

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

Hello,
Recently I’ve pulled changes from SDL 1.2 trunk and there is problem
with SDL_Quit.

It looks like this (here is snippet):

#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif

ifdef HAVE_SIGACTION
struct sigaction action;
sigaction(SIGINT, NULL, &action);
if ( action.sa_handler == SIG_DFL && action.sa_sigaction ==
(void*)SIG_DFL ) {
action.sa_handler = SDL_HandleSIG;
sigaction(SIGINT, &action, NULL);
}
sigaction(SIGTERM, NULL, &action);
if ( action.sa_handler == SIG_DFL && action.sa_sigaction ==
(void*)SIG_DFL ) {
action.sa_handler = SDL_HandleSIG;
sigaction(SIGTERM, &action, NULL);
}

The problem is that compiler complains that action struct doesn’t have
member ‘sa_sigaction’, so lines:

if ( action.sa_handler == SIG_DFL && action.sa_sigaction ==
(void*)SIG_DFL )

and

if ( action.sa_handler == SIG_DFL && action.sa_sigaction == (void*)SIG_DFL )

break the build.

Someone has told me that sa_sigaction required by POSIX, but it also
says: "The storage occupied by sa_handler and sa_sigaction may overlap,
and a conforming application shall not use both simultaneously."
And sa_sigaction field is only valid if the SA_SIGINFO flag is set, and
it never equals (void*)SIG_DFL in that case.
So it looks like an error for me.

I’m using gcc 4.3.2.

P.S. How can I obtain write access to Mercurial SDL 1.2 branch. I wrote
two weeks ago to feedback address from the main page, but I didn’t
received any reply yet.

Regards,
Pawel Goralski
@Pawel_Goralski

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJOHIUhAAoJEBDLM06eKs6dvYsH/RmLFceo5aCcdOrDYUSRzo7R
bGl8nYiM2MGMx8OaMCB6KagC+aO5ejBBOJDfsnjee6jGa6ateyybJsiElZKIIHDw
3eyOaEdVklUFXRpHpTq1EWzyA4+DAKbggbFbpy/HJ21j2icH8W+Ju1F/sGQzvP2M
IA4cRdWiL/tNzBpabpbpIHMQVpWawMJ4d9b7AsHzw/1uejil/ja4kmb1UTi504hq
RJSlxZ0jSk0lAWLjHAbp+67C1bc/3zfLWRKF1wMfsXndVB5ZtR1yEWWobmMXOApA
cbGeiqVsLapIcT87oRZPV487nvw4LlVvG2j5QBHWxx7Xy5QPAdp3RlLmrjH2opA=
=fw2S
-----END PGP SIGNATURE-----

-------------- next part --------------
A non-text attachment was scrubbed…
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2844 bytes
Desc: Kryptograficzna sygnatura S/MIME
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20110712/77d45541/attachment.bin

Recently I’ve pulled changes from SDL 1.2 trunk and there is problem
with SDL_Quit.

This is on Linux, right? I’ll take a look at it.

P.S. How can I obtain write access to Mercurial SDL 1.2 branch. I wrote
two weeks ago to feedback address from the main page, but I didn’t
received any reply yet.

We don’t give out write access in most cases; if you send good patches,
we’ll commit them, and if you maintain a Mercurial clone on a public
site like bitbucket.org, we might even pull directly from it if your
patches are consistently good.

Patches sent in “hg export” format will go into revision control as if
you committed them directly.

–ryan.

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

W dniu 2011-07-14 01:49, Ryan C. Gordon pisze:

Recently I’ve pulled changes from SDL 1.2 trunk and there is
problem with SDL_Quit.

This is on Linux, right? I’ll take a look at it.
Well, partially ;). I’m using gcc 4.5.3 cross compiler for Atari TOS
(m68k based) machines under Linux 32/64 bit to be more precise:
http://vincent.riviere.free.fr/soft/m68k-atari-mint/

P.S. How can I obtain write access to Mercurial SDL 1.2 branch. I
wrote two weeks ago to feedback address from the main page, but I
didn’t received any reply yet.

We don’t give out write access in most cases; if you send good
patches, we’ll commit them, and if you maintain a Mercurial clone on
a public site like bitbucket.org, we might even pull directly from it
if your patches are consistently good.

Patches sent in “hg export” format will go into revision control as
if you committed them directly.
Ok, I understand.

Regards,
Pawel
@Pawel_Goralski
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJOHjKgAAoJEBDLM06eKs6dxHMH/3FSCiv/GyrhJusgWVgO9Y0W
NtZ2EF9gS4TuqoEtgB9NO7MHxz+VanscaGzBkg9Q5MuSaHMkOZ+wCQ9NkohjzJiv
dzCQo291cX686eavSb9bd9Ub3EqnfBHwXrVQBXwh/EmTUre9I3B+D9PVOG6o7YXr
0qyUsjvbpZEDqU69fIL2yp6dWBzVtEhSE16tK7QO7vlhgKUP2yf+p0VLwGg3W4O/
ajBuqQ/FyQ3RVtuUysLc8JXthZm5VqDHWpp0mJg7Tnpd5q+x7w+VNvT+IXP+BqDL
1pbA0ktJ69/mwLQ6ySU41UbWPRr6lycbarWIl3UJSgR3Ffs/NSG112qVz75Ow4s=
=iZHs
-----END PGP SIGNATURE-----

-------------- next part --------------
A non-text attachment was scrubbed…
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2844 bytes
Desc: Kryptograficzna sygnatura S/MIME
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20110714/e95c9a6f/attachment.bin

Le Thu, 14 Jul 2011 02:04:48 +0200
Pawe? G?ralski a ?crit:

W dniu 2011-07-14 01:49, Ryan C. Gordon pisze:

Recently I’ve pulled changes from SDL 1.2 trunk and there is
problem with SDL_Quit.

This is on Linux, right? I’ll take a look at it.
Well, partially ;). I’m using gcc 4.5.3 cross compiler for Atari TOS
(m68k based) machines under Linux 32/64 bit to be more precise:
http://vincent.riviere.free.fr/soft/m68k-atari-mint/

Hello,

Here is a patch to check for sa_sigaction member of struct sigaction at
configure stage, and use this info at compile time. This is for SDL-1.2
only, as we do not support 1.3 on Atari, and yes, this platform does
not have sa_sigaction in its libc.–
Patrice Mandin
WWW: http://pmandin.atari.org/
Programmeur Linux, Atari
Sp?cialit?: D?veloppement, jeux

“who writes the code, decides”
-------------- next part --------------
A non-text attachment was scrubbed…
Name: SDL-1.2-sa_sigaction.diff
Type: text/x-diff
Size: 1542 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20110714/549621b3/attachment.diff

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

Hi,
This patch maybe will fix compilation issue in case sa_sigaction member
doesn’t exist, but it still can give problems in the future for POSIX
compliant systems with both sa_sigaction and sa_handler. Like I have
mentioned in my first post:

“The storage occupied by sa_handler and sa_sigaction may overlap,
and a conforming application shall not use both simultaneously.”

Regards,
Pawel

W dniu 2011-07-14 15:43, Patrice Mandin pisze:

Le Thu, 14 Jul 2011 02:04:48 +0200 Pawe? G?ralski
<@Pawel_Goralski> a ?crit:

W dniu 2011-07-14 01:49, Ryan C. Gordon pisze:

Recently I’ve pulled changes from SDL 1.2 trunk and there is
problem with SDL_Quit.

This is on Linux, right? I’ll take a look at it.
Well, partially ;). I’m using gcc 4.5.3 cross compiler for Atari
TOS (m68k based) machines under Linux 32/64 bit to be more
precise: http://vincent.riviere.free.fr/soft/m68k-atari-mint/

Hello,

Here is a patch to check for sa_sigaction member of struct sigaction
at configure stage, and use this info at compile time. This is for
SDL-1.2 only, as we do not support 1.3 on Atari, and yes, this
platform does not have sa_sigaction in its libc.

_______________________________________________ SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJOIUarAAoJEBDLM06eKs6d5yMH/i3LcYQeKD+hyOi+iRaq4g9h
huahfV0ahorWMYh+ZH6iuWRUJ1C2S5L7wxdNzRQJQQ+IMrNpjqE7ffBJPd4fQkKc
3Vy74pyly15H0+RC9l1SJXqktATiaemyVAvAby/X/Lm7yqQ7YBjfBEYuznn5CtB4
Hd4UKZF8UaHsBSbHbEun4k7RyUGaGnHQ5zdK8qTO104uOdHxVmbFpPNUCXBoJQ+Z
u6YbDsM6D0gdJZX30WKyHoMGbRuo8c2bXqfAFBhNfwGrsnElA71eSMqDprYTbugx
DGWFVSft9i/MDO311OFm+nVTvX3Y+3qAZ0zLp9VQ6rjl4laVXhVe3YSjiFM44ck=
=sW1K
-----END PGP SIGNATURE-----

-------------- next part --------------
A non-text attachment was scrubbed…
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2844 bytes
Desc: Kryptograficzna sygnatura S/MIME
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20110716/848f613c/attachment.bin

Here is a patch to check for sa_sigaction member of struct sigaction at
configure stage, and use this info at compile time. This is for SDL-1.2
only, as we do not support 1.3 on Atari, and yes, this platform does
not have sa_sigaction in its libc.

This is in revision control now, thanks!

–ryan.