summaryrefslogtreecommitdiff
path: root/src/bytecode.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bytecode.c')
-rw-r--r--src/bytecode.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/bytecode.c b/src/bytecode.c
index c7f474d2..a9a5b00b 100644
--- a/src/bytecode.c
+++ b/src/bytecode.c
@@ -3386,12 +3386,16 @@ again:
memcpy( cmd0, cmd->value->data, cmd->value->length );
cmd0[cmd->value->length] = 0;
- int r = system( cmd0 );
+ int res = system( cmd0 );
+
+ if ( WIFSIGNALED( res ) )
+ raise( WTERMSIG( res ) );
+ res = WEXITSTATUS( res );
treeDownref( prg, sp, (Tree*)cmd );
- Value result = r;
- vm_push_value( result );
+ Value val = res;
+ vm_push_value( val );
break;
}