fix fd handle leak

parent d3d9f55b
...@@ -91,6 +91,7 @@ static void opentty(const char * tty, int which) { ...@@ -91,6 +91,7 @@ static void opentty(const char * tty, int which) {
flags &= ~O_NONBLOCK; flags &= ~O_NONBLOCK;
if (fcntl(fd, F_SETFL, flags) < 0) { if (fcntl(fd, F_SETFL, flags) < 0) {
printf("WARN: could not set fd flags: %s\n", strerror(errno)); printf("WARN: could not set fd flags: %s\n", strerror(errno));
close(fd);
return; return;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment