[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Add timeout utility
From: |
Mike Frysinger |
Subject: |
Re: [PATCH] Add timeout utility |
Date: |
Tue, 1 Apr 2008 22:35:14 -0400 |
User-agent: |
KMail/1.9.7 |
On Tuesday 01 April 2008, Pádraig Brady wrote:
> + /* Setup handlers before fork() so that we
> + * handle any signals caused by child, without races. */
> + signal (SIGALRM, cleanup); /* our timeout. */
> + signal (SIGINT, cleanup); /* Ctrl-C at terminal for example. */
> + signal (SIGQUIT, cleanup); /* Ctrl-\ at terminal for example. */
> + signal (SIGTERM, cleanup); /* if we're killed, stop monitored
> process. */ + signal (SIGHUP, cleanup); /* terminal closed for
> example. */ + signal (SIGTTIN, SIG_IGN); /* don't sTop if background
> child needs tty. */ + signal (SIGTTOU, SIG_IGN); /* don't sTop if
> background child needs tty. */
if you're using signal(), you have race problems. why not use sigaction() and
friends instead ?
-mike
signature.asc
Description: This is a digitally signed message part.
Re: [PATCH] Add timeout utility, Pádraig Brady, 2008/04/03