EXPECT_TRUE(fd >= 0) already guards; the enclosing if is flagged always-true by cppcheck. read(-1) is safe.