Skip to content

Commit

Permalink
pty: fix wrong fd check
Browse files Browse the repository at this point in the history
FDs may be 0 so check for >= and not > for fds.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
  • Loading branch information
David Herrmann committed Mar 25, 2012
1 parent 6bcc736 commit 0392fb8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/pty.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ static int setup_child(int master, struct winsize *ws)

err_out:
ret = -errno;
if (slave > 0)
if (slave >= 0)
close(slave);
close(master);
return ret;
Expand Down

0 comments on commit 0392fb8

Please sign in to comment.