Remove a useless check if fd is negative
If `slave` is negative, neither `dup2(slave,0)` or `close(slave)` should be executed. I believe this check is completely useless.
This commit is contained in:
parent
a32981b6b8
commit
f9d0bc22f5
Notes:
git
2024-11-29 03:38:42 +00:00
@ -180,7 +180,7 @@ obtain_ctty(int master, int slave, const char *slavename, char *errbuf, size_t e
|
||||
dup2(slave,0);
|
||||
dup2(slave,1);
|
||||
dup2(slave,2);
|
||||
if (slave < 0 || slave > 2) (void)!close(slave);
|
||||
if (slave > 2) (void)!close(slave);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user