mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-20 04:28:07 -05:00
Switch round a bogus if statement I've just noticed. Both the write to
pty_utmp_helper_pipe _and_ the close of it if we're not going to write should be conditionalised on the pipe existing, rather than just the former! [originally from svn r9729]
This commit is contained in:
parent
7c22b1d755
commit
9a7dd918da
@ -748,10 +748,11 @@ static const char *pty_init(void *frontend, void **backend_handle, Conf *conf,
|
|||||||
* 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 (pty_utmp_helper_pipe >= 0) { /* if it's < 0, we can't anyway */
|
||||||
if (!conf_get_int(conf, CONF_stamp_utmp)) {
|
if (!conf_get_int(conf, CONF_stamp_utmp)) {
|
||||||
close(pty_utmp_helper_pipe); /* just let the child process die */
|
close(pty_utmp_helper_pipe); /* just let the child process die */
|
||||||
pty_utmp_helper_pipe = -1;
|
pty_utmp_helper_pipe = -1;
|
||||||
} else if (pty_utmp_helper_pipe >= 0) {
|
} 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) {
|
||||||
@ -765,6 +766,7 @@ static const char *pty_init(void *frontend, void **backend_handle, Conf *conf,
|
|||||||
pos += ret;
|
pos += ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NOT_X_WINDOWS /* for Mac OS X native compilation */
|
#ifndef NOT_X_WINDOWS /* for Mac OS X native compilation */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user