mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-10 09:58:01 +00:00
I think I've just fixed Debian bug #166396. The +ut option was
causing pty_utmp_helper_pipe to be closed, but its fd was kept around even when stale, and closed again when the main child process terminated - by which time the fd number had been reused for a rather more vital fd, which GTK didn't appreciate having closed under its feet. Hence, spin on POLLNVAL. Should now be sorted. [originally from svn r3185]
This commit is contained in:
parent
dc2af8af66
commit
80c3a23abc
11
unix/pty.c
11
unix/pty.c
@ -517,9 +517,10 @@ static const char *pty_init(void *frontend, void **backend_handle, Config *cfg,
|
|||||||
* Stamp utmp (that is, tell the utmp helper process to do so),
|
* Stamp utmp (that is, tell the utmp helper process to do so),
|
||||||
* or not.
|
* or not.
|
||||||
*/
|
*/
|
||||||
if (!cfg->stamp_utmp)
|
if (!cfg->stamp_utmp) {
|
||||||
close(pty_utmp_helper_pipe); /* just let the child process die */
|
close(pty_utmp_helper_pipe); /* just let the child process die */
|
||||||
else {
|
pty_utmp_helper_pipe = -1;
|
||||||
|
} else {
|
||||||
char *location = get_x_display(pty_frontend);
|
char *location = get_x_display(pty_frontend);
|
||||||
int len = strlen(location)+1, pos = 0; /* +1 to include NUL */
|
int len = strlen(location)+1, pos = 0; /* +1 to include NUL */
|
||||||
while (pos < len) {
|
while (pos < len) {
|
||||||
@ -527,6 +528,7 @@ static const char *pty_init(void *frontend, void **backend_handle, Config *cfg,
|
|||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
perror("pterm: writing to utmp helper process");
|
perror("pterm: writing to utmp helper process");
|
||||||
close(pty_utmp_helper_pipe); /* arrgh, just give up */
|
close(pty_utmp_helper_pipe); /* arrgh, just give up */
|
||||||
|
pty_utmp_helper_pipe = -1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
pos += ret;
|
pos += ret;
|
||||||
@ -666,7 +668,10 @@ static void pty_close(void)
|
|||||||
close(pty_master_fd);
|
close(pty_master_fd);
|
||||||
pty_master_fd = -1;
|
pty_master_fd = -1;
|
||||||
}
|
}
|
||||||
close(pty_utmp_helper_pipe); /* this causes utmp to be cleaned up */
|
if (pty_utmp_helper_pipe >= 0) {
|
||||||
|
close(pty_utmp_helper_pipe); /* this causes utmp to be cleaned up */
|
||||||
|
pty_utmp_helper_pipe = -1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user