util: Set SIGPIPE to a no-op handler in virFork
util: Set SIGPIPE to a no-op handler in virFork

Libvirtd has set SIGPIPE to ignored, and virFork resets all signal
handlers to the defaults. But child process may write logs to
stderr/stdout, that may generate SIGPIPE if journald has stopped.

So set SIGPIPE to a dummy no-op handler before unmask signals in
virFork(), and the handler will get reset to SIG_DFL when execve()
runs. Now we can delete sigaction() call entirely in virExec().

Reviewed-by: Daniel P. Berrangé <bb938cf255e055ff3507f2627d214e8e62118fcf@redhat.com>
Signed-off-by: Wang Yechao <d156c2278b59b97b85e8218b42611783bb8435e2@zte.com.cn>

jardasgit/libvirt,crobinso/libvirt,olafhering/libvirt,fabianfreyer/libvirt,jfehlig/libvirt,nertpinx/libvirt,nertpinx/libvirt,libvirt/libvirt,olafhering/libvirt,crobinso/libvirt,fabianfreyer/libvirt,zippy2/libvirt,jfehlig/libvirt,nertpinx/libvirt,fabianfreyer/libvirt,zippy2/libvirt,jfehlig/libvirt,zippy2/libvirt,libvirt/libvirt,jardasgit/libvirt,crobinso/libvirt,fabianfreyer/libvirt,jfehlig/libvirt,libvirt/libvirt,fabianfreyer/libvirt,jardasgit/libvirt,jardasgit/libvirt,libvirt/libvirt,zippy2/libvirt,jardasgit/libvirt,olafhering/libvirt,olafhering/libvirt,nertpinx/libvirt,nertpinx/libvirt,crobinso/libvirt