Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c7fea2f

Browse files
committed
add sigrelse() call for SunOS 4.1; add some fflush() calls
1 parent d8b4925 commit c7fea2f

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Parser/myreadline.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ my_readline(prompt)
117117
}
118118
old_inthandler = signal(SIGINT, onintr);
119119
if (setjmp(jbuf)) {
120+
#ifdef HAVE_SIGRELSE
121+
/* This seems necessary on SunOS 4.1 (Rasmus Hahn) */
122+
sigrelse(SIGINT);
123+
#endif
120124
signal(SIGINT, old_inthandler);
121125
return NULL;
122126
}
@@ -140,8 +144,10 @@ my_readline(prompt)
140144
n = 100;
141145
if ((p = malloc(n)) == NULL)
142146
return NULL;
147+
fflush(stdout);
143148
if (prompt)
144149
fprintf(stderr, "%s", prompt);
150+
fflush(stderr);
145151
switch (my_fgets(p, n, stdin)) {
146152
case 0: /* Normal case */
147153
break;

0 commit comments

Comments
 (0)