Re: [PATCH v5] util: Set SIGPIPE to a no-op handler invirFork

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> > @@ -783,7 +773,10 @@ virExec(virCommandPtr cmd)
> >      if (virCommandHandshakeChild(cmd) < 0)
> >         goto fork_error;
> >
> > -    if (sigaction(SIGPIPE, &waxon, NULL) < 0) {
> > +    memset(&sig_action, 0, sizeof(sig_action));
> > +    sig_action.sa_handler = SIG_DFL;
> > +    sigemptyset(&sig_action.sa_mask);
> > +    if (sigaction(SIGPIPE, &sig_action, NULL) < 0) {
> >          virReportSystemError(errno, "%s",
> >                               _("Could not re-enable SIGPIPE"));
> >          goto fork_error;
>
> We can just delete this sigaction() call entirely. The execve() call
> will purge the no-op handler function we registered in virFork(),
> resetting it back to SIG_DFL, so no need todo it manually here.

ok, i'll adjust the code and push another patch.
---
Best wishes
Wang Yechao
--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux