diff options
author | axel <axel@liljencrantz.se> | 2005-10-14 00:11:29 +1000 |
---|---|---|
committer | axel <axel@liljencrantz.se> | 2005-10-14 00:11:29 +1000 |
commit | f321855c0293ec56c9f61c163bd1ac8927aabd1b (patch) | |
tree | cefc95961342a371bdfe6380fa1006d78ac3034b /proc.c | |
parent | 0385fbe2be6d1fb03c6fdbc7ca2efb6fe2ff7ce6 (diff) |
Fix event notification bug that caused read errors
darcs-hash:20051013141129-ac50b-db6358e297f91ba48a5e2435e12c3e037fb02410.gz
Diffstat (limited to 'proc.c')
-rw-r--r-- | proc.c | 11 |
1 files changed, 6 insertions, 5 deletions
@@ -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 ) { |