From: Karel Zak <kzak@redhat.com>
To: Chen Qi <Qi.Chen@windriver.com>
Cc: util-linux@vger.kernel.org
Subject: Re: replace siginterrupt with sigaction
Date: Mon, 31 Aug 2015 11:37:43 +0200 [thread overview]
Message-ID: <20150831093743.GE2726@ws.net.home> (raw)
In-Reply-To: <1441009426-13799-3-git-send-email-Qi.Chen@windriver.com>
On Mon, Aug 31, 2015 at 04:23:46PM +0800, Chen Qi wrote:
> Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
> ---
> login-utils/login.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/login-utils/login.c b/login-utils/login.c
> index ebb76f5..38c881b 100644
> --- a/login-utils/login.c
> +++ b/login-utils/login.c
> @@ -1110,6 +1110,7 @@ int main(int argc, char **argv)
> char *buff;
> int childArgc = 0;
> int retcode;
> + struct sigaction act;
>
> char *pwdbuf = NULL;
> struct passwd *pwd = NULL, _pwd;
> @@ -1123,7 +1124,9 @@ int main(int argc, char **argv)
> timeout = (unsigned int)getlogindefs_num("LOGIN_TIMEOUT", LOGIN_TIMEOUT);
>
> signal(SIGALRM, timedout);
> - siginterrupt(SIGALRM, 1); /* we have to interrupt syscalls like ioctl() */
> + (void) sigaction(SIGALRM, NULL, &act);
> + act.sa_flags &= ~SA_RESTART;
> + sigaction(SIGALRM, &act, NULL);
Applied, thanks.
(Please, next time be more verbose in commit message why you want to
do the change -- I have added a note that siginterrupt is obsolete).
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
next prev parent reply other threads:[~2015-08-31 9:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-31 8:23 [PATCH] sys-utils/Makemodule.am: fix parallel build issue Chen Qi
2015-08-31 8:23 ` include errno.h instead of argp.h Chen Qi
2015-08-31 9:33 ` Karel Zak
2015-08-31 8:23 ` replace siginterrupt with sigaction Chen Qi
2015-08-31 9:37 ` Karel Zak [this message]
2015-08-31 9:27 ` [PATCH] sys-utils/Makemodule.am: fix parallel build issue Karel Zak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150831093743.GE2726@ws.net.home \
--to=kzak@redhat.com \
--cc=Qi.Chen@windriver.com \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox