File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 2626
2727namespace {
2828
29- // Return true if |fd| is a fifo or pipe descriptor .
30- bool IsFifoDescriptor (int fd) {
29+ // Return true if |fd| is a fifo or character device .
30+ bool IsJobserverDescriptor (int fd) {
3131 struct stat info;
3232 int ret = ::fstat (fd, &info);
33- return (ret == 0 ) && ((info.st_mode & S_IFMT) == S_IFIFO);
33+ return (ret == 0 ) && (((info.st_mode & S_IFMT) == S_IFIFO) ||
34+ ((info.st_mode & S_IFMT) == S_IFCHR));
3435}
3536
3637// Implementation of Jobserver::Client for Posix systems
@@ -89,7 +90,7 @@ class PosixJobserverClient : public Jobserver::Client {
8990 std::string (" Error opening fifo for reading: " ) + strerror (errno);
9091 return false ;
9192 }
92- if (!IsFifoDescriptor (read_fd_)) {
93+ if (!IsJobserverDescriptor (read_fd_)) {
9394 *error = " Not a fifo path: " + fifo_path;
9495 // Let destructor close read_fd_.
9596 return false ;
You can’t perform that action at this time.
0 commit comments