Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: up-arrow no longer works right
- X-seq: zsh-users 13953
- From: Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
- To: Zsh Users List <zsh-users@xxxxxxxxxx>
- Subject: Re: up-arrow no longer works right
- Date: Fri, 20 Mar 2009 20:31:23 +0000
- In-reply-to: <200903202052.15787.arvidjaar@xxxxxxxxx>
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <d2ecb10b0903191838y68e1dfbbsa80289a52256eb2a@xxxxxxxxxxxxxx> <090320073326.ZM3499@xxxxxxxxxxxxxxxxxxxxxx> <20090320151617.GF22844@xxxxxxxxxxxxxxxxxxx> <200903202052.15787.arvidjaar@xxxxxxxxx>
On Fri, 20 Mar 2009 20:52:12 +0300
Andrey Borzenkov <arvidjaar@xxxxxxxxx> wrote:
> Actually zsh explicitly contains code to retry failed system call:
>
> # ifdef HAVE_TCGETATTR
> # ifndef TCSADRAIN
> # define TCSADRAIN 1 /* XXX Princeton's include files are screwed up
> */
> # endif
> tcsetattr(SHTTY, TCSADRAIN, &ti->tio);
> while (tcsetattr(SHTTY, TCSADRAIN, &ti->tio) == -1 && errno ==
> EINTR)
> ;
> # else
> ioctl(SHTTY, TCSETS, &ti->tio);
> while (ioctl(SHTTY, TCSETS, &ti->tio) == -1 && errno == EINTR)
> # endif
> /* zerr("settyinfo: %e",errno)*/ ;
>
> (looks like somewhat misplaced `;' but this should not be the reason).
This was a fairly recent change, however. I'm not sure why the
tcsettattr() occurs twice, now I look again, but it's not occurring
twice in Vincent's trace, as it would with the new code. Older code
would print the message "bad tcgets", though.
2009-03-02 Peter Stephenson <pws@xxxxxxx>
* Lionel Flandrin: 26625: Src/utils.c: inopportune interrupt
could wreck terminal set up.
Index: Src/utils.c
===================================================================
RCS file: /cvsroot/zsh/zsh/Src/utils.c,v
retrieving revision 1.214
diff -u -r1.214 utils.c
--- Src/utils.c 15 Mar 2009 01:04:51 -0000 1.214
+++ Src/utils.c 20 Mar 2009 20:27:57 -0000
@@ -1442,14 +1442,13 @@
# ifndef TCSADRAIN
# define TCSADRAIN 1 /* XXX Princeton's include files are screwed up */
# endif
- tcsetattr(SHTTY, TCSADRAIN, &ti->tio);
while (tcsetattr(SHTTY, TCSADRAIN, &ti->tio) == -1 && errno == EINTR)
;
# else
- ioctl(SHTTY, TCSETS, &ti->tio);
while (ioctl(SHTTY, TCSETS, &ti->tio) == -1 && errno == EINTR)
+ ;
# endif
- /* zerr("settyinfo: %e",errno)*/ ;
+ /* zerr("settyinfo: %e",errno);*/
#else
# ifdef HAVE_TERMIO_H
ioctl(SHTTY, TCSETA, &ti->tio);
--
Peter Stephenson <p.w.stephenson@xxxxxxxxxxxx>
Web page now at http://homepage.ntlworld.com/p.w.stephenson/
Messages sorted by:
Reverse Date,
Date,
Thread,
Author