try harder to put background jobs in background; do not print in response to SIGPIPE

This commit is contained in:
rsc 2005-03-18 19:03:25 +00:00
parent ca30274bd9
commit 4ee543e58c
4 changed files with 45 additions and 1 deletions

View file

@ -1,3 +1,5 @@
#include <u.h>
#include <signal.h>
#include "rc.h"
#include "getflags.h"
#include "exec.h"
@ -11,7 +13,9 @@ Xasync(void)
{
int null = open("/dev/null", 0);
int pid;
int tcpgrp, pgrp;
char npid[10];
if(null<0){
Xerror("Can't open /dev/null\n");
return;
@ -22,6 +26,12 @@ Xasync(void)
Xerror("try again");
break;
case 0:
/*
* Should make reads of tty fail, writes succeed.
*/
signal(SIGTTIN, SIG_IGN);
signal(SIGTTOU, SIG_IGN);
pushredir(ROPEN, null, 0);
start(runq->code, runq->pc+1, runq->local);
runq->ret = 0;