From f321855c0293ec56c9f61c163bd1ac8927aabd1b Mon Sep 17 00:00:00 2001 From: axel Date: Fri, 14 Oct 2005 00:11:29 +1000 Subject: [PATCH] Fix event notification bug that caused read errors darcs-hash:20051013141129-ac50b-db6358e297f91ba48a5e2435e12c3e037fb02410.gz --- proc.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/proc.c b/proc.c index 72d6a50f5..c23da4fb5 100644 --- a/proc.c +++ b/proc.c @@ -485,9 +485,9 @@ static void fire_process_event( const wchar_t *msg, pid_t pid, int status ) al_push( &event_arg, msg ); - sb_printf( &event_pid, L"%d", pid ); + sb_printf( &event_pid, L"%d", pid ); al_push( &event_arg, event_pid.buff ); - + sb_printf( &event_status, L"%d", status ); al_push( &event_arg, event_status.buff ); @@ -527,9 +527,10 @@ int job_reap( int interactive ) if( !p->pid ) continue; - fire_process_event( L"PROCESS_EXIT", p->pid, WEXITSTATUS( s ) ); s = p->status; + fire_process_event( L"PROCESS_EXIT", p->pid, ( WIFSIGNALED(s)?-1:WEXITSTATUS( s )) ); + if( WIFSIGNALED(s) ) { /* @@ -586,9 +587,9 @@ int job_reap( int interactive ) found=1; } } - job_free(j); - fire_process_event( L"JOB_EXIT", -j->pgid, 0 ); + + job_free(j); } else if( job_is_stopped( j ) && !j->notified ) {