mirror of
https://github.com/fish-shell/fish-shell.git
synced 2026-05-28 01:01:12 -03:00
Exportable universal variables
darcs-hash:20050922201652-ac50b-f70e7607b4ace24da4020f2d432718dc335e5bdd.gz
This commit is contained in:
31
proc.c
31
proc.c
@@ -45,6 +45,7 @@ Some of the code in this file is based on code from the Glibc manual.
|
||||
#include "reader.h"
|
||||
#include "sanity.h"
|
||||
#include "env.h"
|
||||
#include "parser.h"
|
||||
|
||||
/**
|
||||
Size of message buffer
|
||||
@@ -540,7 +541,7 @@ static void handle_child_status( pid_t pid, int status )
|
||||
int found_proc = 0;
|
||||
job_t *j;
|
||||
process_t *p;
|
||||
// char mess[MESS_SIZE];
|
||||
char mess[MESS_SIZE];
|
||||
found_proc = 0;
|
||||
/*
|
||||
snprintf( mess,
|
||||
@@ -587,13 +588,12 @@ static void handle_child_status( pid_t pid, int status )
|
||||
}
|
||||
|
||||
|
||||
if( !is_interactive )
|
||||
if( WIFSIGNALED( status ) &&
|
||||
( WTERMSIG(status)==SIGINT ||
|
||||
WTERMSIG(status)==SIGQUIT ) )
|
||||
{
|
||||
|
||||
if( WIFSIGNALED( status ) &&
|
||||
( WTERMSIG(status)==SIGINT ||
|
||||
WTERMSIG(status)==SIGQUIT ) )
|
||||
{
|
||||
if( !is_interactive_session )
|
||||
{
|
||||
struct sigaction act;
|
||||
sigemptyset( & act.sa_mask );
|
||||
act.sa_flags=0;
|
||||
@@ -602,6 +602,23 @@ static void handle_child_status( pid_t pid, int status )
|
||||
sigaction( SIGQUIT, &act, 0 );
|
||||
kill( getpid(), WTERMSIG(status) );
|
||||
}
|
||||
else
|
||||
{
|
||||
block_t *c = current_block;
|
||||
|
||||
snprintf( mess,
|
||||
MESS_SIZE,
|
||||
"Process %ls from job %ls exited through signal, breaking loops\n",
|
||||
p->actual_cmd,
|
||||
j->command );
|
||||
write( 2, mess, strlen(mess ));
|
||||
|
||||
while( c )
|
||||
{
|
||||
c->skip=1;
|
||||
c=c->outer;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if( !found_proc )
|
||||
|
||||
Reference in New Issue
Block a user