projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Add a missing error check in pterm's child-process setup. Shouldn't
[u/mdw/putty]
/
unix
/
uxpty.c
diff --git
a/unix/uxpty.c
b/unix/uxpty.c
index
5ebd050
..
4a606ef
100644
(file)
--- a/
unix/uxpty.c
+++ b/
unix/uxpty.c
@@
-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",