[prev in list] [next in list] [prev in thread] [next in thread] 

List:       miros-discuss
Subject:    Re: another *ksh bug: pipelines
From:       Thorsten Glaser <tg () mirbsd ! de>
Date:       2008-07-13 17:25:02
Message-ID: Pine.BSM.4.64L.0807131723110.26752 () herc ! mirbsd ! org
[Download RAW message or body]

Dixi:

>I spotted another thing which is, in my eyes, a bug. If you have a number
>of commands concatenated together, like this:
>| a && b && c
>then I expect b to run when a is (1) finished and (2) successfully, and c
>if both a and b finished successfully.

Interesting workaround:

$ (sleep 10 && echo test)

Parentheses involve a subshell invocation, and I suspect that the subshell
gets the SIGTSTP instead of the sleep process. Code in question:

	case TAND:
		rv = execute(t->left, XERROK);
		if (t->right != NULL && (rv == 0) == (t->type == TAND))
			rv = execute(t->right, flags & XERROK);
		else
			flags |= XERROK;
		break;

I wonder if there is a way to let the first execute either not return on
SIGTSTP (and SIGSTOP, which behaves just the same) or catch it and re-run
or re-wait.

//mirabilos
-- 
Sometimes they [people] care too much: pretty printers [and syntax highligh-
ting, d.A.] mechanically produce pretty output that accentuates irrelevant
detail in the program, which is as sensible as putting all the prepositions
in English text in bold font.	-- Rob Pike in "Notes on Programming in C"
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic