Skip to content

Commit 93cb096

Browse files
committed
Add missing parentheses
& has higher precedence than ==, making this a noop. Use the less error-prone S_IS* macros instead. Found by clang.
1 parent eeb54c6 commit 93cb096

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/node_stdio.cc

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,7 @@ static bool IsBlocking(int fd) {
163163
perror("fstat");
164164
return true;
165165
}
166-
if (s.st_mode & S_IFSOCK == S_IFSOCK) return false;
167-
if (s.st_mode & S_IFIFO == S_IFIFO) return false;
168-
return true;
166+
return !S_ISSOCK(s.st_mode) && !S_ISFIFO(s.st_mode);
169167
}
170168

171169

0 commit comments

Comments
 (0)