Re: help needed to fix contrib/ee crash/exit when receiving SIGWINCH

2009-10-24 Thread Ed Schouten
Hy Eygene,

* Eygene Ryabinkin  wrote:
> Sent the patch to bug-ncur...@gnu.org.  Do you think that I should
> send it to Thomas directly as well?

Probably not. bug-ncurses@ should be good enough. Thanks!

-- 
 Ed Schouten 
 WWW: http://80386.nl/


pgp38kOKPpvEE.pgp
Description: PGP signature


Re: help needed to fix contrib/ee crash/exit when receiving SIGWINCH

2009-10-24 Thread Jilles Tjoelker
On Fri, Oct 23, 2009 at 07:56:35PM +0400, Eygene Ryabinkin wrote:
> Hmm, we can transform this code to the following one:
> -
> errno = 0;
> do {
>   in = wgetch(text_win);
> } while (errno == EINTR);
> if (in == -1)
>   exit(0);
> -
> This won't help with FreeBSD's ncurses, but may be other variants
> will feel much better with such a event loop variant.

That should be:
-
do
in = wgetch(text_win);
while (in == -1 && errno == EINTR);
if (in == -1)
exit(0);
-

errno should only be checked after failed function calls or for
functions where it is documented that errno should be used to check for
error conditions (example: readdir).

-- 
Jilles Tjoelker
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"


Re: help needed to fix contrib/ee crash/exit when receiving SIGWINCH

2009-10-24 Thread Eygene Ryabinkin
Sat, Oct 24, 2009 at 02:04:34PM +0200, Jilles Tjoelker wrote:
> That should be:
> -
> do
>   in = wgetch(text_win);
> while (in == -1 && errno == EINTR);
> if (in == -1)
>   exit(0);
> -
> 
> errno should only be checked after failed function calls or for
> functions where it is documented that errno should be used to check for
> error conditions (example: readdir).

True, thanks for correction!
-- 
Eygene
 ____   _.--.   #
 \`.|\.....-'`   `-._.-'_.-'`   #  Remember that it is hard
 /  ' ` ,   __.--'  #  to read the on-line manual
 )/' _/ \   `-_,   /#  while single-stepping the kernel.
 `-'" `"\_  ,_.-;_.-\_ ',  fsc/as   #
 _.-'_./   {_.'   ; /   #-- FreeBSD Developers handbook
{_.-``-' {_/#
___
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscr...@freebsd.org"