On 30 July 2012 13:20, Lionel Cons <lionelcons1...@googlemail.com> wrote:
> On 30 July 2012 10:18, ольга крыжановская <olga.kryzhanov...@gmail.com> wrote:
>> David, Glenn, I have attached a stability patch (it is an old patch
>> from Roland, I finished, polished and tested it) for ksh93u+ (yes, for
>> the stable branch, since the underlying issue is nasty and impossible
>> to recover from unless with a restart of xterm) to solve problems with
>> terminals when signals arrive at the same time a ioctl() for said
>> terminal is being worked on. In such cases the ioctl() is interrupted
>> with EINTR, and if it is not repeated leaves the terminal in an
>> undefined state, either hanging the session, leaving it in an
>> undefined state (e.g. stty stops reporting the terminal lines/columns
>> figures and only presents the terminal type defaults, which makes use
>> of vi, less, more and other curses/ncurses apps useless) or other
>> strange effects which require a restart of the terminal.
>>
>> It would be nice if I could get 3 reviews (Irek? Glenn? Clark?), since
>> this is for the stable branch.
>
> I'll have my staff review it later today. How much time do I have for review?

-               return(ioctl(fd,mode,&ott));
+               EINTR_REPEAT(iores=ioctl(fd,mode,&ott)) == -1);
+               return(iores);

There seems to be a missing ( bracket.

+#      define tcgetattr(fd,tty) sh_tcgetattr((fd), (tty))      
+static
+int sh_tcgetattr(int fd, int tty)
+{
+       int iores;
+       EINTR_REPEAT((iores=ioctl(fd, TCGETS, tty)) == -1);
+       return iores;
+}

You could make such small "static" functions in header "static inline".

-#         define tcgetpgrp(a) (ioctl(a, TIOCGPGRP, &_i_)>=0?_i_:-1)    
+#         define tcgetpgrp(a) EINTR_REPEAT((ioctl((a), TIOCGPGRP,
&_i_)>=0?_i_:-1) == -1)

You did use "static" functions in previous cases. Why the heart of change here?

You remove src/cmd/ksh93/tests/arrays.sh. Why?

There are other calls to open() and close() which are not protected by
EINTR_REPEAT. Why? Those system calls are subject to EINTR
interruptions too. They will cause random malfunctions if not repeated
for EINTR.

The rest of the patch looks good to me.

Lionel

_______________________________________________
ast-developers mailing list
ast-developers@research.att.com
https://mailman.research.att.com/mailman/listinfo/ast-developers

Reply via email to