On Friday 07 of December 2012 11:57EN, Giacomo Comes wrote:
Right. I run the following command: gzip -dc /boot/initrd | cpio --quiet -t | grep -q libz ; echo ${PIPESTATUS[*]} and here are the results:
openSUSE 11.3: 0 0 0 openSUSE 11.4: 0 141 0 openSUSE 12.1: 141 141 0 openSUSE 12.2: 141 141 0
I'm unable to find where the bug is. The only thing I'm sure is that because of it some shell script that used to work now fail.
Change of the result doesn't necessarily mean a regression. The fact that "grep -q" finishes as soon as it finds a match, is a documented behaviour. If you write to a pipe and reader finishes, you get SIGPIPE, that's standard behaviour. If you are lucky and the output is short, you can avoid being shut down by SIGPIPE thanks to buffering but the only reliable way to avoid it is to ignore or handle it. And I seriously doubt gzip and/or cpio handled/ignored SIGPIPE in older versions and they stopped to do so. It is much more likely that you were just lucky not to hit the problem earlier. If you want to avoid it reliably, use the workaround suggested by Jiri Bohac, i.e. redirecting output of grep to /dev/null instead of "-q". Anyway, this discussion is definitely off-topic in opensuse-kernel list for some time. So far I haven't seen anything indicating this is a kernel problem. Michal Kubeček -- To unsubscribe, e-mail: opensuse-kernel+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-kernel+owner@opensuse.org