• E
    virnetserver: handle sigaction correctly · f4346173
    Eric Blake 提交于
    POSIX says that sa_sigaction is only safe to use if sa_flags
    includes SA_SIGINFO; conversely, sa_handler is only safe to
    use when flags excludes that bit.  Gnulib doesn't guarantee
    an implementation of SA_SIGINFO, but does guarantee that
    if SA_SIGINFO is undefined, we can safely define it to 0 as
    long as we don't dereference the 2nd or 3rd argument of
    any handler otherwise registered via sa_sigaction.
    
    Based on a report by Wen Congyang.
    
    * src/rpc/virnetserver.c (SA_SIGINFO): Stub for mingw.
    (virNetServerSignalHandler): Avoid bogus dereference.
    (virNetServerFatalSignal, virNetServerNew): Set flags properly.
    (virNetServerAddSignalHandler): Drop unneeded #ifdef.
    f4346173
virnetserver.c 21.3 KB