diff --git a/src/syncterm/st_crypt.c b/src/syncterm/st_crypt.c index f70ede65f0af8e51b0102b9c7067e7729031d6aa..c0b2199f6d91d12ccda344e511df243dbec36d74 100644 --- a/src/syncterm/st_crypt.c +++ b/src/syncterm/st_crypt.c @@ -1,6 +1,7 @@ /* Copyright (C), 2007 by Stephen Hurd */ #include <stdio.h> /* NULL */ +#include <unistd.h> /* _exit() */ #include "st_crypt.h" #include <xp_dl.h> @@ -19,6 +20,22 @@ void exit_crypt() #else +/* + * cryptlib calls fork() to gather entropy. + * It then calls exit(). + * This calls the atexit() handlers. + * SDL_Exit is in there... + * SDL doesn't exist in the forked child. + * This causes the child to spin FOREVER + * Eating your CPU. + * So, we will break exit(3). + */ +void exit(int code) +{ + fclose(fopen("/tmp/Dumbass", "w")); + _exit(code); +} + struct crypt_funcs cl; int init_crypt(void)