aboutsummaryrefslogtreecommitdiffhomepage
path: root/signal.c
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-02-10 01:50:20 +1000
committerGravatar axel <axel@liljencrantz.se>2006-02-10 01:50:20 +1000
commitd1c9bca2e9f0eaac2fb8e00e5ed07e8e2906bb02 (patch)
tree9de2b4fd732398afaebd00c732d8fe41762ac322 /signal.c
parent49973b85dac4baf843b95ae22ffaed7f41ae43bc (diff)
Another halloc:ification of fish. Halloc has been extended to allow registering function calls, this has allowed the creation of halloc-handled arraylists, stringbuffers, etc. More job parsing halloc-ification has reduced the error handling code to only a shadow of it's former self
darcs-hash:20060209155020-ac50b-e119c5293ce2368e252cfc01b98ab7c629fdd678.gz
Diffstat (limited to 'signal.c')
-rw-r--r--signal.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/signal.c b/signal.c
index d6f3be8c..dbd3b701 100644
--- a/signal.c
+++ b/signal.c
@@ -43,6 +43,9 @@ struct lookup_entry
const wchar_t *desc;
};
+static int block_count=0;
+
+
/**
Lookup table used to convert between signal names and signal ids,
etc.
@@ -536,13 +539,22 @@ void signal_handle( int sig, int do_handle )
void signal_block()
{
sigset_t chldset;
- sigfillset( &chldset );
- sigprocmask(SIG_BLOCK, &chldset, 0);
+
+ if( !block_count )
+ {
+ sigfillset( &chldset );
+ sigprocmask(SIG_BLOCK, &chldset, 0);
+ }
+ block_count++;
}
void signal_unblock()
{
sigset_t chldset;
- sigfillset( &chldset );
- sigprocmask(SIG_UNBLOCK, &chldset, 0);
+ block_count--;
+ if( !block_count )
+ {
+ sigfillset( &chldset );
+ sigprocmask(SIG_UNBLOCK, &chldset, 0);
+ }
}