open-src/xserver/xorg/catch-dlerrors.patch
changeset 705 24ca414edbff
parent 660 457a0e9b07d7
equal deleted inserted replaced
704:f9b973ecc909 705:24ca414edbff
    29 6813925 Xorg needs to catch ld.so.1 failure so it can close down devices cleanly
    29 6813925 Xorg needs to catch ld.so.1 failure so it can close down devices cleanly
    30 
    30 
    31 Catch errors loading libraries at runtime so we can clean up when a lazyloaded
    31 Catch errors loading libraries at runtime so we can clean up when a lazyloaded
    32 library fails to open correctly.
    32 library fails to open correctly.
    33 
    33 
    34 --- os/osinit.c	2008-11-05 08:52:17.000000000 -0800
    34 diff -urp -x '*~' -x '*.orig' configure.ac configure.ac
    35 +++ os/osinit.c	2009-03-05 14:44:17.792553000 -0800
    35 --- configure.ac	2009-05-08 17:42:50.197784000 -0700
    36 @@ -54,6 +54,8 @@
    36 +++ configure.ac	2009-05-08 17:42:58.915352000 -0700
       
    37 @@ -101,7 +101,7 @@ AM_CONDITIONAL(XSERVER_DTRACE, [test "x$
       
    38  
       
    39  AC_HEADER_DIRENT
       
    40  AC_HEADER_STDC
       
    41 -AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h])
       
    42 +AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h dlfcn.h])
       
    43  
       
    44  dnl Checks for typedefs, structures, and compiler characteristics.
       
    45  AC_C_CONST
       
    46 diff -urp -x '*~' -x '*.orig' os/osinit.c os/osinit.c
       
    47 --- os/osinit.c	2009-04-14 10:14:57.000000000 -0700
       
    48 +++ os/osinit.c	2009-05-08 17:42:58.916721000 -0700
       
    49 @@ -54,6 +54,10 @@ SOFTWARE.
    37  #include "os.h"
    50  #include "os.h"
    38  #include "osdep.h"
    51  #include "osdep.h"
    39  #include <X11/Xos.h>
    52  #include <X11/Xos.h>
    40 +#include <dlfcn.h>
    53 +#ifdef HAVE_DLFCN_H
       
    54 +# include <dlfcn.h>
       
    55 +#endif
    41 +#include <signal.h>
    56 +#include <signal.h>
    42  
    57  
    43  #ifdef SMART_SCHEDULE
       
    44  #include "dixstruct.h"
    58  #include "dixstruct.h"
    45 @@ -92,6 +94,17 @@
       
    46  
    59  
    47  Bool OsDelayInitColors = FALSE;
    60 @@ -88,6 +92,17 @@ int limitStackSpace = -1;
       
    61  int limitNoFile = -1;
       
    62  #endif
    48  
    63  
    49 +static void OsSigHandler(int signo)
    64 +static void OsSigHandler(int signo)
    50 +{
    65 +{
    51 +    const char *dlerr = dlerror();
    66 +    const char *dlerr = dlerror();
    52 +
    67 +
    58 +}
    73 +}
    59 +
    74 +
    60  void
    75  void
    61  OsInit(void)
    76  OsInit(void)
    62  {
    77  {
    63 @@ -100,6 +113,16 @@
    78 @@ -96,6 +111,16 @@ OsInit(void)
    64      static char* devnull = "/dev/null";
    79      static char* devnull = "/dev/null";
    65      char fname[PATH_MAX];
    80      char fname[PATH_MAX];
    66  
    81  
    67 +#ifdef RTLD_DI_SETSIGNAL
    82 +#ifdef RTLD_DI_SETSIGNAL
    68 +    /* Tell runtime linker to send a signal we can catch instead of SIGKILL
    83 +    /* Tell runtime linker to send a signal we can catch instead of SIGKILL