server: Print a message if wineserver crashes and we don't dump cores.
This commit is contained in:
parent
20a886164f
commit
0cd0626de0
|
@ -7036,6 +7036,7 @@ done
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
for ac_header in \
|
for ac_header in \
|
||||||
|
@ -7119,6 +7120,7 @@ for ac_header in \
|
||||||
sys/poll.h \
|
sys/poll.h \
|
||||||
sys/ptrace.h \
|
sys/ptrace.h \
|
||||||
sys/reg.h \
|
sys/reg.h \
|
||||||
|
sys/resource.h \
|
||||||
sys/scsiio.h \
|
sys/scsiio.h \
|
||||||
sys/shm.h \
|
sys/shm.h \
|
||||||
sys/signal.h \
|
sys/signal.h \
|
||||||
|
|
|
@ -252,6 +252,7 @@ AC_CHECK_HEADERS(\
|
||||||
sys/poll.h \
|
sys/poll.h \
|
||||||
sys/ptrace.h \
|
sys/ptrace.h \
|
||||||
sys/reg.h \
|
sys/reg.h \
|
||||||
|
sys/resource.h \
|
||||||
sys/scsiio.h \
|
sys/scsiio.h \
|
||||||
sys/shm.h \
|
sys/shm.h \
|
||||||
sys/signal.h \
|
sys/signal.h \
|
||||||
|
|
|
@ -734,6 +734,9 @@
|
||||||
/* Define to 1 if you have the <sys/reg.h> header file. */
|
/* Define to 1 if you have the <sys/reg.h> header file. */
|
||||||
#undef HAVE_SYS_REG_H
|
#undef HAVE_SYS_REG_H
|
||||||
|
|
||||||
|
/* Define to 1 if you have the <sys/resource.h> header file. */
|
||||||
|
#undef HAVE_SYS_RESOURCE_H
|
||||||
|
|
||||||
/* Define to 1 if you have the <sys/scsiio.h> header file. */
|
/* Define to 1 if you have the <sys/scsiio.h> header file. */
|
||||||
#undef HAVE_SYS_SCSIIO_H
|
#undef HAVE_SYS_SCSIIO_H
|
||||||
|
|
||||||
|
|
|
@ -28,6 +28,9 @@
|
||||||
#ifdef HAVE_SYS_POLL_H
|
#ifdef HAVE_SYS_POLL_H
|
||||||
#include <sys/poll.h>
|
#include <sys/poll.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef HAVE_SYS_RESOURCE_H
|
||||||
|
#include <sys/resource.h>
|
||||||
|
#endif
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "file.h"
|
#include "file.h"
|
||||||
|
@ -215,6 +218,13 @@ static void do_sigchld( int signum )
|
||||||
do_signal( handler_sigchld );
|
do_signal( handler_sigchld );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* SIGSEGV handler */
|
||||||
|
static void do_sigsegv( int signum )
|
||||||
|
{
|
||||||
|
fprintf( stderr, "wineserver crashed, please report this.\n");
|
||||||
|
abort();
|
||||||
|
}
|
||||||
|
|
||||||
/* SIGIO handler */
|
/* SIGIO handler */
|
||||||
#ifdef HAVE_SIGINFO_T_SI_FD
|
#ifdef HAVE_SIGINFO_T_SI_FD
|
||||||
static void do_sigio( int signum, siginfo_t *si, void *x )
|
static void do_sigio( int signum, siginfo_t *si, void *x )
|
||||||
|
@ -241,6 +251,17 @@ int watchdog_triggered(void)
|
||||||
return watchdog != 0;
|
return watchdog != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int core_dump_disabled( void )
|
||||||
|
{
|
||||||
|
int r = 0;
|
||||||
|
#ifdef RLIMIT_CORE
|
||||||
|
struct rlimit lim;
|
||||||
|
|
||||||
|
r = !getrlimit(RLIMIT_CORE, &lim) && (lim.rlim_cur == 0);
|
||||||
|
#endif
|
||||||
|
return r;
|
||||||
|
}
|
||||||
|
|
||||||
void init_signals(void)
|
void init_signals(void)
|
||||||
{
|
{
|
||||||
struct sigaction action;
|
struct sigaction action;
|
||||||
|
@ -279,6 +300,11 @@ void init_signals(void)
|
||||||
action.sa_handler = do_sigterm;
|
action.sa_handler = do_sigterm;
|
||||||
sigaction( SIGQUIT, &action, NULL );
|
sigaction( SIGQUIT, &action, NULL );
|
||||||
sigaction( SIGTERM, &action, NULL );
|
sigaction( SIGTERM, &action, NULL );
|
||||||
|
if (core_dump_disabled())
|
||||||
|
{
|
||||||
|
action.sa_handler = do_sigsegv;
|
||||||
|
sigaction( SIGSEGV, &action, NULL );
|
||||||
|
}
|
||||||
action.sa_handler = SIG_IGN;
|
action.sa_handler = SIG_IGN;
|
||||||
sigaction( SIGXFSZ, &action, NULL );
|
sigaction( SIGXFSZ, &action, NULL );
|
||||||
#ifdef HAVE_SIGINFO_T_SI_FD
|
#ifdef HAVE_SIGINFO_T_SI_FD
|
||||||
|
|
Loading…
Reference in New Issue