diff --git a/SPPI.cpp b/SPPI.cpp index 2eaa03d..7dd11ba 100644 --- a/SPPI.cpp +++ b/SPPI.cpp @@ -21,7 +21,7 @@ void SPPI::__init(int __mode, int __bits_per_word, int __max_speed_hz) { throw std::system_error(errno, std::system_category(), "failed to get page size"); fd = open(path_.c_str(), O_RDWR); - if (page_size == -1) + if (fd == -1) throw std::system_error(errno, std::system_category(), "failed to open device"); if (__mode > 0)