2004-11-04 02:02:27

by Blaisorblade

[permalink] [raw]
Subject: [patch 09/20] uml: use SIG_IGN for empty sighandler


Avoid creating a dummy no-op procedure instead of using SIG_IGN.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <[email protected]>
---

vanilla-linux-2.6.9-paolo/arch/um/drivers/chan_user.c | 6 +-----
1 files changed, 1 insertion(+), 5 deletions(-)

diff -puN arch/um/drivers/chan_user.c~uml-use-SIG_IGN-for-empty-handling arch/um/drivers/chan_user.c
--- vanilla-linux-2.6.9/arch/um/drivers/chan_user.c~uml-use-SIG_IGN-for-empty-handling 2004-11-03 23:44:59.439523936 +0100
+++ vanilla-linux-2.6.9-paolo/arch/um/drivers/chan_user.c 2004-11-03 23:44:59.442523480 +0100
@@ -37,10 +37,6 @@ int generic_console_write(int fd, const
return(err);
}

-static void winch_handler(int sig)
-{
-}
-
struct winch_data {
int pty_fd;
int pipe_fd;
@@ -63,7 +59,7 @@ static int winch_thread(void *arg)
printk("winch_thread : failed to write synchronization "
"byte, err = %d\n", -count);

- signal(SIGWINCH, winch_handler);
+ signal(SIGWINCH, SIG_IGN);
sigfillset(&sigs);
sigdelset(&sigs, SIGWINCH);
if(sigprocmask(SIG_SETMASK, &sigs, NULL) < 0){
_


2004-11-04 02:42:33

by Jeff Dike

[permalink] [raw]
Subject: Re: [patch 09/20] uml: use SIG_IGN for empty sighandler

[email protected] said:
> Avoid creating a dummy no-op procedure instead of using SIG_IGN.

Andrew, can you hold off on this one? I did that on purpose, and as soon
as I remember why, I'll know whether this patch is good :-)

The other patches are OK by me. Consider them acked.

Jeff

2004-11-04 04:34:36

by Blaisorblade

[permalink] [raw]
Subject: Re: [uml-devel] Re: [patch 09/20] uml: use SIG_IGN for empty sighandler

On Thursday 04 November 2004 05:51, Jeff Dike wrote:
> [email protected] said:
> > Avoid creating a dummy no-op procedure instead of using SIG_IGN.
>
> Andrew, can you hold off on this one?

> I did that on purpose, and as soon
> as I remember why, I'll know whether this patch is good :-)
I had a doubt on this, but I was not getting much feedback from you...
Also, if you reject this, I'd require a comment-only patch for it:
"as soon as I remember why" makes me think back to my yesterday's class, when
the teacher said "put comments in your code or you'll soon forget what it
does!" 8-O (yes, 1st year University student :-( ).

> The other patches are OK by me. Consider them acked.
Very fine.

--
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729


Attachments:
(No filename) (783.00 B)
(No filename) (189.00 B)
Download all attachments

2004-11-05 04:39:16

by Jeff Dike

[permalink] [raw]
Subject: Re: [uml-devel] Re: [patch 09/20] uml: use SIG_IGN for empty sighandler

[email protected] said:
> I had a doubt on this, but I was not getting much feedback from you...
Yeah, sorry.

> Also, if you reject this, I'd require a comment-only patch for it: "as
> soon as I remember why" makes me think back to my yesterday's class,
> when the teacher said "put comments in your code or you'll soon
> forget what it does!" 8-O (yes, 1st year University student :-( ).

The thing is, you often don't realize what's going to be mysterious until it
actually is, and then it's too late for the comment :-)

In this case, it wants to be bounced out of sigprocmask when a SIGWINCH
arrives. In order to do so, it must have a handler registered, even if
it does nothing.

Jeff