Hi Alan,

Thanks for your review. We roll back to use sigaction() and fix the
issue, please review the new patch.

Thanks,
Halton.

On Thu, 2009-10-15 at 08:15 -0700, Alan Coopersmith wrote:
> signal() is unsafe, unportable, and deprecated.   sigaction() is almost
> always preferred.   (On SysV OS'es, including Solaris, signal() resets
> the signal handler to the default when the signal is received, leaving
> a race condition before the handler can reassert it - sigaction does not
> do this.   See "Advanced Programming in the Unix Environment" or "Solaris
> Systems Programming" for much greater details - Sun employees can read
> either online for free through Sun's safari subscription.   A shorter
> online description can be read at:
> http://stackoverflow.com/questions/231912/what-is-the-difference-between-sigaction-and-signal
> )
> 
> I'll bet the actual cause and more correct fix is the failure to initialize
> the sa_mask & sa_flags members of the sigaction struct, and the failure to
> check if sigaction() returned an error.
> 
>       -Alan Coopersmith-           alan.coopersmith at sun.com
>        Sun Microsystems, Inc. - X Window System Engineering
> 
> 
> Halton Huo wrote:
> > Hi,
> > 
> > console-kit-daemon will receive SIGPOLL when VT is switched, this will
> > cause c-k-d exit. It is because the process does not go into
> > handle_vt_active() as we wish.
> > 
> > Aaron helps me find out that using signal() rather than sigaction() fix
> > this issue.
> >     
> > Refer to bug http://defect.opensolaris.org/bz/show_bug.cgi?id=11612 for
> > more information.
> > 
> > Thanks,
> > Halton.
> > 
> 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ConsoleKit-05-sol-sigpoll.diff
Type: text/x-patch
Size: 724 bytes
Desc: not available
URL: 
<http://mail.opensolaris.org/pipermail/jds-review/attachments/20091016/03382e69/attachment.bin>

Reply via email to