Package: xmoto Version: 0.5.9+dfsg-1 Severity: serious Tags: patch Justification: fails to build from source (but built successfully in the past)
Hi, new xmoto 0.5.9 fails on ia64, kfreebsd and hurd because of the unconditional "usage" of the sa_restorer field of struct sigaction. POSIX[1] does not specify a sa_restorer field at all, and in the Linux manpages[2] it is declared as obsolete and advertized against its use. After all, what the code is really doing is to reset all the fields of the struct sigaction v_act; what can be done to do that in a simplier (and portable) way is just to memset it to 0 before using it (this also avoids to manually set sa_flags, and a #ifdef snippet there). Attached there is a patch for it (I admittely tested it only on Hurd, but I think it should make xmoto compile on all the archs mentioned above). [1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/sigaction.html [2] http://www.kernel.org/doc/man-pages/online/pages/man2/sigaction.2.html Thanks, -- Pino
--- a/src/GameInit.cpp +++ b/src/GameInit.cpp @@ -268,12 +268,9 @@ void GameApp::run_load(int nNumArgs, cha if(v_xmArgs.isOptServerOnly()) { struct sigaction v_act; + memset(&v_act, 0, sizeof(struct sigaction)); v_act.sa_handler = xmexit_term; -#if !defined(__APPLE__) && !defined(__FreeBSD__) - v_act.sa_restorer = NULL; -#endif sigemptyset(&v_act.sa_mask); - v_act.sa_flags = 0; if(sigaction(SIGTERM, &v_act, NULL) != 0) { LogWarning("sigaction failed");