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.
slave
dup2(slave,0)
close(slave)
Remove a useless check if fd is negative
If
slave
is negative, neitherdup2(slave,0)
orclose(slave)
shouldbe executed. I believe this check is completely useless.