Skip to content
Snippets Groups Projects
Commit 05bc7180 authored by deuce's avatar deuce
Browse files

For UNIX systems, use the C99 _Exit() instead of exit() in the random

child to avoid bad interactions with the SDL atexit() handlers.
parent 4405f31e
Branches
Tags
No related merge requests found
...@@ -46,6 +46,7 @@ $(CRYPTLIB_BUILD): $(3RDP_ROOT)$(DIRSEP)dist/cryptlib.zip | $(CRYPT_SRC) $(CRYPT ...@@ -46,6 +46,7 @@ $(CRYPTLIB_BUILD): $(3RDP_ROOT)$(DIRSEP)dist/cryptlib.zip | $(CRYPT_SRC) $(CRYPT
@echo Creating $@ ... @echo Creating $@ ...
$(QUIET)-rm -rf $(CRYPT_SRC)/* $(QUIET)-rm -rf $(CRYPT_SRC)/*
$(QUIET)unzip -oa $(3RDPDISTDIR)$(DIRSEP)cryptlib.zip -d $(CRYPT_SRC) $(QUIET)unzip -oa $(3RDPDISTDIR)$(DIRSEP)cryptlib.zip -d $(CRYPT_SRC)
$(QUIET)patch -d $(CRYPT_SRC) < random_exit.patch
$(QUIET)patch -d $(CRYPT_SRC) < SSL-fix.patch $(QUIET)patch -d $(CRYPT_SRC) < SSL-fix.patch
ifdef DEBUG ifdef DEBUG
$(QUIET)env - PATH=$(PATH) make -C $(CRYPT_SRC) debug $(QUIET)env - PATH=$(PATH) make -C $(CRYPT_SRC) debug
......
--- random/unix.c.orig 2012-07-14 00:50:55.000000000 -0700
+++ random/unix.c 2012-07-14 00:52:28.000000000 -0700
@@ -161,7 +161,7 @@
process, which calls exit() rather than returning */
#define ENSURES_EXIT( x ) \
- if( !( x ) ) { assert( INTERNAL_ERROR ); exit( -1 ); }
+ if( !( x ) ) { assert( INTERNAL_ERROR ); _Exit( -1 ); }
/* The structure containing information on random-data sources. Each record
contains the source and a relative estimate of its usefulness (weighting)
@@ -544,7 +544,7 @@
/* We are the child, connect the read side of the pipe to stdout and
unplug stdin and stderr */
if( dup2( pipedes[ STDOUT_FILENO ], STDOUT_FILENO ) < 0 )
- exit( 127 );
+ _Exit( 127 );
if( ( fd = open( "/dev/null", O_RDWR ) ) > 0 )
{
dup2( fd, STDIN_FILENO );
@@ -616,7 +616,7 @@
#ifdef HAS_VFORK
_exit( 127 );
#else
- exit( 127 );
+ _Exit( 127 );
#endif /* Unixen that have vfork() */
}
@@ -1539,7 +1539,7 @@
/* "Thou child of the daemon, ... wilt thou not cease...?"
-- Acts 13:10 */
- exit( 0 );
+ _Exit( 0 );
}
/* Unix slow poll. If a few of the randomness sources create a large amount
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment