1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-04-09 23:28:06 -05:00

Add a missing error check in pterm's child-process setup. Shouldn't

really fail, but might as well be careful.

[originally from svn r9931]
This commit is contained in:
Simon Tatham 2013-07-19 17:44:22 +00:00
parent 33f485c1c3
commit 1d21346d4c

View File

@ -820,7 +820,11 @@ static const char *pty_init(void *frontend, void **backend_handle, Conf *conf,
pgrp = getpid();
tcsetpgrp(0, pgrp);
setpgid(pgrp, pgrp);
close(open(pty->name, O_WRONLY, 0));
{
int ptyfd = open(pty->name, O_WRONLY, 0);
if (ptyfd >= 0)
close(ptyfd);
}
setpgid(pgrp, pgrp);
{
char *term_env_var = dupprintf("TERM=%s",