# HG changeset patch # User reimar # Date 1275065836 0 # Node ID edfa98275e045b5e2a29e470ef29d3b9219457ab # Parent aff74c63b86d6732b4c34c285b15d860668f9090 Fix cache process accidentally being killed by SIGUSR1. diff -r aff74c63b86d -r edfa98275e04 stream/cache2.c --- a/stream/cache2.c Fri May 28 11:52:12 2010 +0000 +++ b/stream/cache2.c Fri May 28 16:57:16 2010 +0000 @@ -351,6 +351,9 @@ */ static void cache_mainloop(cache_vars_t *s) { int sleep_count = 0; +#if FORKED_CACHE + signal(SIGUSR1, SIG_IGN); +#endif do { if (!cache_fill(s)) { #if FORKED_CACHE @@ -401,6 +404,10 @@ if (min > s->buffer_size - s->fill_limit) { min = s->buffer_size - s->fill_limit; } + // to make sure we wait for the cache process/thread to be active + // before continuing + if (min <= 0) + min = 1; #if FORKED_CACHE if((stream->cache_pid=fork())){